I'm writing a route for area but I got a problem on same URL. This is my web structure:
Project Authentication:
AccountController
|__SignIn
Project Account:
AccountController
|__ChangePassword
I write routes:
First route in AccountAreaRegistration:
context.MapRoute(
"Account_Default",
"Account/{action}/{id}",
new
{
controller = "Account",
id = UrlParameter.Optional
},
new[] { "MyProject.Account.Controllers" });
Second route in AuthenticationAreaRegistration:
context.MapRoute(
"Authentication_Account",
"Account/SignIn",
new
{
controller = "Account",
action = "SignIn",
id = UrlParameter.Optional
},
new[] { "MyProject.Authentication.Controllers" });
First route is more priority than second route because AccountAreaRegistration is called before AuthenticationAreaRegistration.
When I open URL: ~/Account/SignIn -> I get error Resource not found because this URL match with first route. How to solve my problem. Thanks.