@{ Page.Title = "Sign in"; Layout = "~/themes/" + Blog.Theme + "/_Layout.cshtml"; Response.Cache.SetCacheability(HttpCacheability.NoCache); if (Request.HttpMethod == "POST") { string username = Request.Form["username"]; string password = Request.Form["password"]; string remember = Request.Form["remember"]; if (!string.IsNullOrEmpty(username) && !string.IsNullOrEmpty(password)) { if (FormsAuthentication.Authenticate(username, password)) { FormsAuthentication.RedirectFromLoginPage(username, remember == "on"); } } else if (!string.IsNullOrEmpty(Request.QueryString["signout"])) { FormsAuthentication.SignOut(); Response.Redirect(Request.QueryString["ReturnUrl"], true); } } } @if (!User.Identity.IsAuthenticated) {

Sign in

@if (Request.HttpMethod == "POST") {

Username or password is incorrect

}
} else {

You are already signed in

}