Reputation: 389
i want to build a route entry for a url http://example.com/foo which should map to Index(string foo) action method of a controller named User.
At the same time the default Home Controller should not be affected and should work normally
any help is greatly appreciated
Thanks
Upvotes: 0
Views: 86
Reputation: 1038720
You could try putting this before the default route:
routes.MapRoute(
"FooRoute",
"{foo}",
new
{
controller = "Home",
action = "Index",
foo = UrlParameter.Optional
}
);
Upvotes: 0