Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you want to still be able to access the value of color-id through Querystring, then you should look at <strong>Rewriting</strong>. This can be due to legacy code that you can't change or other forms of interacting with 3rd party code. The benefit or <code>Rewriting</code> is that the code that ends up being executed doesn't know how the url looked like before it was rewritten and it can keep working as if there were a Querystring parameter named <code>ColorID</code>.</p> <p>In its simplest form you need to call the Rewrite method of HttpContext, which will spin up a new request internally that executes code that matches that url without the user noticing anything. One caveat of this can be, that your legacy code doesn't know how to render correct links in menus and stuff, so you would keep having urls like <code>?ColorID=Red</code> where it should have been just <code>Red</code>.</p> <p>In IIS 7 and up, there is a built in filter where you can write your rules and patterns so you don't need to write your own code that matches incoming requests and calls <code>HttpContext.Rewrite</code>. Read more about it <a href="http://www.iis.net/download/urlrewrite" rel="nofollow noreferrer">here</a> on MSDN.</p> <p>Now, <strong>Routing</strong> is a whole other thing. Its a Asp.net feature and doesn't work on top of existing legacy code but needs to be used with it. Meaning that the executing code needs to know that the request was routed to it. This of course has many benefits and of you're writing a new system then i would definitively recommend using <strong>Routing</strong> over <strong>Rewriting</strong>. There is a <a href="http://learn.iis.net/page.aspx/496/iis-url-rewriting-and-aspnet-routing/" rel="nofollow noreferrer">good article here</a> about the differences and some SO questions also cover the topic:</p> <ul> <li><a href="https://stackoverflow.com/questions/90112/iis-url-rewriting-vs-url-routing">IIS URL Rewriting vs URL Routing</a></li> <li><a href="https://stackoverflow.com/questions/915771/asp-net-url-rewriting-vs-routing">Url Rewriting vs. Routing</a></li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload