I have an asp.net web application and right now users can get there profiles by putting int http://www.webdomain.com/page.aspx?usename=myusername. I would like to change it to http://www.webdomain.com/username. Thanks for any help.
Share
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.
Sample IRouteConstraint:
And, to register the route in the Global.asax:
In my case, my user list never changes during the application life cycle so I can cache it by using a static list. I would suggest that you modify the code so that you’re doing what ever check to make sure the value entered is a username inside of the Match.