@model YourNamespace.Models.LoginModel
<title>Login Page</title>
font-family: Arial, sans-serif;
background-color: #f4f4f4;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
width: calc(100% - 10px);
background-color: #007bff;
input[type="submit"]:hover {
background-color: #0056b3;
@using (Html.BeginForm())
@Html.LabelFor(m => m.Username)
@Html.TextBoxFor(m => m.Username)
@Html.LabelFor(m => m.Password)
@Html.PasswordFor(m => m.Password)
<input type="submit" value="Login" />
@if (ViewBag.Erro input[type="submit"] {
background-color: #007bff;
input[type="submit"]:hover {
background-color: #0056b3;
@using (Html.BeginForm())
@Html.LabelFor(m => m.Username)
@Html.TextBoxFor(m => m.Username)
@Html.LabelFor(m => m.Password)
@Html.PasswordFor(m => m.Password)
<input type="submit" value="Login" />
@if (ViewBag.ErrorMessage != null)
<div>@ViewBag.ErrorMessage</div>
@if (ViewBag.Username != null)
<script>alert("Username: @ViewBag.Username");</script>
<div>@ViewBag.ErrorMessage</div>
@if (ViewBag.Username != null)
<script>alert("Username: @ViewBag.Username");</script>