Imported from the CodePlex archive for reference purposes. Support for MvcCodeRouting has ended.
Can you tell me more about why you need this? Right now I don't see why people would want to use an extension.
Basically, I have an application that is a bag of mixed-technologies. We have Castle monorail, ASP.NET Webforms, and some old custom HttpHandlers. Currently Monorail is configured to use extension-less urls, so that means that ASP NET MVC must be mapped to an extension so the two don't overlap.
One other possibility for this need is a hosting provider that does not support extension-less URLs, but I am not sure how common that is.
I hope that makes sense! Again, I REALLY appreciate this library; makes organizing a large project so much easier.
Your situation is very rare, so I'm not too excited to work on a feature that only one person would use. The hosting argument is another story, but I'm also not sure how common that would be, I think it's pretty standard for a web server to support extension-less URLs these days.
Are you sure you cannot have both Monorail and ASP.NET MVC use extension-less URLs ? Maybe if you set the routing modules in the appropriate order, the UrlRoutingModule could try to handle the request and if it can't find a route that matches it would pass control to the Monorail module. One advantage of using this library is that it creates very strict routes, so in theory it should work (I think).
If that doesn't work you'll have to download the source code and make these changes in the ControllerInfo.cs source file (Note where I added ".mvc"):
public string UrlTemplate { get { return String.Join("/", BaseRouteSegments .Concat((!IsRootController) ? new[] { "{controller}" + ".mvc" } : new string[0]) ); } } public string ControllerUrl { get { return String.Join("/", BaseRouteSegments .Concat((!IsRootController) ? new[] { Name + ".mvc" } : new string[0]) ); } }
I understand, and thanks for showing the source that needs to be changed!