How do I redirect a route to another route in ASP.NET web forms?

坚强是说给别人听的谎言 提交于 2019-12-05 07:08:35

You can use something like this

Response.RedirectToRoute("Survey");

the parameter "Survey" is routeName you defined in Global.asax using MapPageRoute. RedirectToRoute also has other overloads that allow you to pass route parameters if required

If you really don't want to create a physical file for /Surveys then you can use IIS url rewriting capabilities to redirect all requests from /Surveys to /Survey. Check out this link to see how to do it in IIS.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!