Url.Action outside the Area

1

I've separated the asp.net mvc user registry in an area

Control Area

In a registration action, it sends the confirmation link, it is generated as follows

var callbackUrl = Url.Action("ConfirmEmail", "Account", new { userId = user.Id, code = code }, protocol: Request.Url.Scheme);

When you receive the email, it looks like this:

http://localhost:50855/Controle/Account/ConfirmEmail?userId..

It ends up getting the name of the area, and the Account is outside the area

How can I resolve this?

    
asked by anonymous 04.09.2014 / 21:15

1 answer

2

Just make it clear that Action does not use Area :

var callbackUrl = Url.Action("ConfirmEmail", "Account", new { userId = user.Id, code = code, area = "" }, protocol: Request.Url.Scheme);
    
04.09.2014 / 21:41