Reputation: 5962
I simply wants to route a URL which is not in the MVC project. Like
http://mysite.com/Parents/default.aspx?ID=xxx
TO
http://mysite.com/accounts/login
with the ID
Upvotes: 4
Views: 2445
Reputation: 194
If you want to redirect all .aspx pages to redirect at "accounts/login" then do like below
routes.MapRoute(
"Page",
"{name}.aspx",
new { controller = "Accounts", action = "Login", id = UrlParameter.Optional }
);
Upvotes: 4
Reputation: 1080
I think something like this would work.
routes.MapRoute(
name: "Default",
url: "Parents/default.aspx?ID={id}",
defaults: new { controller = "Accounts", action = "Login", id = UrlParameter.Optional }
);
Upvotes: 6