ASP.NET: Path in place of URL arguments
Someone asked on Stack Overflow:
I’ve been taking URL arguments in ASP.NET like so:
www.mysite.com/thread.php?id=123However, I’d like to use the cleaner method that you often see which looks like:
www.mysite.com/thread/123How can I do this (get the arguments) in ASP.NET? What’s the usual procedure for setting up a system like this?
I posted the following answer, which was chosen as the accepted answer and received 1 upvote:
What that is called, is Url Rewriting. If you are using the ASP.NET-MVC Framework, you get this behavior by default, along with a design pattern that helps make developing it easier.
If you’re trying to shoehorn this onto an existing application, I recommend that you look into some url rewriting modules.
Notable comments
Nate (0 upvotes): In visual studio, a “website” is just a bunch of aspx files in a folder, in an “application” there is a .prj file that keeps track of what files are in the project.
Originally posted on Stack Overflow — 1 upvotes (accepted answer). Licensed under CC BY-SA.