1)Pease change to your default route:
routes.MapRoute(
"DefaultSite",
"{controller}/{action}/{id}",
new
{
controller ="Account",
action ="LogOn",
id = UrlParameter.Optional
}
);
2)Load partial on Master Load file:
@using (Html.BeginForm("LogOn","Account",HttpMethod.Post))
{
@Html.AntiForgeryToken()
@Html.Partial( "~/Views/Home/LogOn.cshtml", new MyProject.Models.LogOnModel())
}
3)And Account contrroller in added your logon logice:
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult Login(LogOnModel model)
{
if (ModelState.IsValid)
{
//TODO:
return RedirectToAction("index", "home");
}
// If we got this far, something failed, redisplay form
ModelState.AddModelError("", @"The user name or password provided is incorrect.");
return View(model);
}