I had the following code snippet in my Razor layout view (which is used by all the views in my application):
@using (Html.BeginForm("Logout", "Account", FormMethod.Post, new { id = ViewIDs.Shared._AuthenticationPartial.LogoutForm })) {
This worked great with my Home and Account views, i.e. displayed the form that was submitted to ~ / Account / Logout. However, when it is used with a view inside the Person area, it unexpectedly goes to the ~ / Person / Account / Logout folder.
Now I was able to fix it as follows:
@using (Html.BeginForm("Logout", "Account", new { area = "" }, FormMethod.Post, new { id = ViewIDs.Shared._AuthenticationPartial.LogoutForm })) {
Is this done correctly, i.e. is the default area the current area? Or am I having a configuration problem in my application?
Fabian schmied
source share