Title. MVC Project, mobile website. The company's official, after the user concerned, click on the corresponding menu can use the relevant features.
Recent projects have been refactored, and some nonstandard naming methods have been reconstructed. On-line, found some Web pages can not be accessed.
Contact Maintenance maintenance Personnel inconvenient, then, how to modify our program can solve it?
The following workaround:
1. Web. config handlers
How to set it is not OK.
2. Global.asax, intercept request do jump, did not become.
3.RegisterRoutes, add Maproute to RouteCollection, get it done. Here's the code:
Public Static voidregisterroutes (routecollection routes) {routes. Ignoreroute ("{Resource}.axd/{*pathinfo}"); //Note:defaultcontroller The original name of the Mailitemcontroller, I changed to Defaultcontroller afterhttp://localhost: 5120/mailitem/wpyjpage can't access it. Add the following routemap to it. (Note: The default route must be placed before "default")//As configured below, the valid Access form is:http://localhost: 5120/mailitem/wpyjpageroutes. MapRoute ("MailItem",//Route name "Mailitem/{action}",//URL with Parameters New{controller ="Default", action ="Vipservicepage"}//parameter Default value ); //As configured below, the valid Access form is:http://localhost: 5120/default/wpyjpageroutes. MapRoute ("Default",//Route name "{Controller}/{action}/{id}",//URL with Parameters New{controller ="Default", action ="Vipservicepage", id = urlparameter.optional}//parameter Default value ); ////As configured below, the valid Access form is:http://localhost: 5120/default/wpyjpage.htm //routes. MapRoute (//"MailItem",//Route name//"{controller}/{action}.htm",//URL with Parameters//New {controller = "Default", action = "Vipservicepage"}//parameter Default value//);}
MVC Project Controller renamed, with the original page URL can not access, how to do?