I have a asp.net mvc project and when comming to the loginPage my url looks like:
I don't want it to look like this, and in the routConfig file I've done this:
routes.MapRoute(
name: "LogIn",
url: "LogIn",
defaults: new { controller = "Account", action = "Login" }
);
Which should make the url like this:
What am I missing?
EDIT:
The Login action:
[AllowAnonymous]
public ActionResult Login()
{
return View();
}
EDIT 2: @pwas mentioned that this is being setup in the view so I altered it by removing the returnUrl paramater:
<section role="main" id="login">
<div class="panel center-block logInBlock" style="width:300px;">
<div class="panel-heading loginHeadPadding"><h1>Logga in</h1></div>
<div class="panel-body loginBodyPadding">
@using (Html.BeginForm("Login", "Account", new { }, FormMethod.Post, new { @class = "form-horizontal", role = "form" }))
{
@Html.AntiForgeryToken()
<div class="form-group text-left">
@Html.LabelFor(m => m.UserName, "Användarnamn")
@Html.TextBoxFor(m => m.UserName, new { @class = "form-control", placeholder = "Användarnamn" })
</div>
<div class="form-group text-left">
@Html.LabelFor(m => m.Password, "Lösenord")
@Html.PasswordFor(m => m.Password, new { @class = "form-control", placeholder = "Lösenord" })
</div>
<input type="submit" value="Logga in" class="btn btn-primary btn-block" />
@Html.ValidationSummary(true, "", new { @class = "text-danger" })
}
</div>
</div>
</section>
Problem still remains