Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Route an aspx url to MVC controller

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

like image 578
Syed Umar Ahmed Avatar asked Dec 26 '22 21:12

Syed Umar Ahmed


1 Answers

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 }
        );
like image 88
Moe Bataineh Avatar answered Jan 03 '23 10:01

Moe Bataineh