ASP.NET Routing in Global.asax

房东的猫 提交于 2019-12-01 16:03:41

You do not need to specify the name of your website as part of the route, try with this code:

routes.MapPageRoute("", "{combinedPin}", "~/Default.aspx");

With the above code, your link would look like:

http://localhost:12345/WebsiteName/test36u

If however your intention is that your users access your site using a segment named: WebsiteName then use:

routes.MapPageRoute("", "WebsiteName/{combinedPin}", "~/Default.aspx");

But in the precedent code your users will have to access your resource as follows: (probably not the expected result though)

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