Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I create userfriendly urls like stackoverflow?

I want to create a similar type of url as stack overflow does when a question is created.

Example:

Non-ajax GET/POST using jQuery (plugin?)non-ajax-get-post-using-jquery-plugin

I am particularly interested in the last part which I have highlighed in bold. How do you achieve the affect of adding the title of the page to the url with the delimiter?

What is this technique called?

like image 621
Cunners Avatar asked Jul 20 '09 05:07

Cunners


1 Answers

Use ASP.NET routing rather than rewriting when possible. It's available with both MVC and Web Forms. Routing is much more flexible and does a better job in passing context to the processing code, handling postbacks, etc.

You can also use the IIS7 Rewrite Module to handle rewriting at the webserver level before your ASP.NET code executes. There's some good information on how to do that here.

like image 140
Jon Galloway Avatar answered Nov 08 '22 08:11

Jon Galloway