preventing routing to folders in asp.net routing -
Trying to implement the expanded url in the asp.net webform using
Route Add ("Myrouting", new route ("{PagePath}", New MyRouteHandler ("~ / Default.aspx")));This extensionless URL works properly, but in some cases it is happy that the routing path actually exists in the form of real physical path.
Example: Localhost / Service 404 throws an exception because the root has an actual folder called service.
How do I exclude routing of directories?
Thanks
The following code may be that you get close control of that URL Need be
Public static zero register routs (example: with interval routes with this file extension and later with any additional text. Ignoreroute ("{resource} .axd / {* pathInfo}"); ... // Example: New way to modify a URL and remove .aspx extension roots MapRoute ("UrlManagerRoute", "{* url}", new {controller = "microcontroller", action = "myaction"}, new {url = @ ". * .. aspx (/.*)?"}); ...}
Comments
Post a Comment