How do I create a custom route handler in ASP.NET MVC?
相关问题
- MVC-Routing,Why i can not ignore defaults,The matc
- parameters in routing do not work MVC 3
- Improve converting string to readable urls
- There is no ViewData item with the key 'taskTy
- TextBoxFor decimal
相关文章
- How to get a list of connected clients on SignalR
- How do you redirect to the calling page in ASP.NET
- Change color of bars depending on value in Highcha
- The program '[4432] iisexpress.exe' has ex
- ASP.Net MVC 4 Bundles
- How to get server path of physical path ?
- Cannot implicitly convert Web.Http.Results.JsonRes
- entity type has no key defined - Code first
ASP.NET MVC makes it easy to create a custom route handler in the Global.asax.cs:
This will result in all requests being handled by the custom RouteHandler specified. For this particular handler:
You can then do whatever you want, in this case the SubDomainMvcHandler grabs the subdomain from the URL and passes it through to the controller as a property: