I’m trying to add a route that shows some data based on a string parameter like this:
http://whatever.com/View/078x756
How do I create that simple route and where to put it?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In your
global.asax.csfile, you add the following lines:Make sure you add them before the registration of the default route – the ASP.NET MVC Framework will look throught the routes in order and take the first one that matches your url. Phil Haack’s Routing Debugger is a valuable tool when troubleshooting this.