asp.net mvc 3 - MVC3 MapRoute, parameter with slashes -
how create maproute accepts slashes without considering new parameter? if url is
http://localhost/root/p1/default.aspx
i want 1 parameter pick after localhost (root/p1/default.aspx). take 3 parameters because there 2 slashes, , maproute separates parameters slash. if route looks like
routes.maproute( "urlmaproute", "{path}", new { controller = "home", action = "index", path = "default.aspx" } );
then {path} picks everything, though url contains slashes.
you use catchall route:
routes.maproute( "urlmaproute", "{*path}", new { controller = "home", action = "index", path = "default.aspx" } );
and then:
public actionresult index(string path) { ... }
Comments
Post a Comment