In an asp.net mvc application, I would like to be able to generate views, where the routing engine will create all URLs that point to a different site, i.e. change the application path.
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.
Can’t be done with standard routes. Routing is intended to generate URLs within the current application. After all, if you generate URLs outside your application, routing has no idea that something will be there to match the route.
You either can write your own custom routes that derive from Route (or RouteBase) and do the logic yourself, or use IIS URL Rewriting.