I had the following piece of code in my Razor Layout view (which is shared by all views in my application):
@using (Html.BeginForm("Logout", "Account", FormMethod.Post, new { id = ViewIDs.Shared._AuthenticationPartial.LogoutForm })) {
This worked fine with my Home and Account views, i.e., it rendered a form that posted to ~/Account/Logout. However, when used with a view inside an area called "Person", it suddenly posted to ~/Person/Account/Logout.
Now, I was able to fix this as follows:
@using (Html.BeginForm("Logout", "Account", new { area = "" }, FormMethod.Post, new { id = ViewIDs.Shared._AuthenticationPartial.LogoutForm })) {
Is this the right way to do this, i.e., is the default area by definition the current area? Or am I having a configuration problem in my application?
new { area = "" }
because the default area is current area. – Egocentric