Url.Action outside the Area

Asked

Viewed 274 times

1

I separated the user registration of Asp.net mvc into an area

Area Control

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..

He ends up taking the name of the area, being that the Account is outside the area

How can I fix this?

1 answer

3


Just explain that the Action does not use Area:

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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.