第一次使用MVC,我想改变位置,并想要更改徽标。在此之后我写了@using
错误是Parser Error发生了什么?
@using Angga.Models
@model LoginViewModel
@{ ViewBag.Title = "Log in"; }
<div class="col-sm-4">
</div>
<div class="col-sm-4">
@using (Html.BeginForm("Login", "Account", new { ReturnUrl = ViewBag.ReturnUrl }, FormMethod.Post, new { @class = "form-horizontal", role = "form"})) { @Html.AntiForgeryToken()
<div class="page animsition vertical-align text-center" data-animsition-in="fade-in" data-animsition-out="fade-out" style="animation-duration: 800ms; opacity: 1;">
<div class="page-content vertical-align-middle">
<div class="panel">
<div class="panel-body">
<div class="brand">
<img class="brand-img" src="~/image/logo-blue.png" alt="..." />
<h2 class="brand-text font-size-18">MYLOYALTY</h2>
</div>
<form method="post" action="customer_search.php" autocomplete="off">
@Html.ValidationSummary(true, "", new {@class = "text-danger"})
<div class="form-group form-material floating">
<!-- Untuk Email-->
<!-- <label class="floating-label">Email</label> -->
<div class="form-group">
@Html.LabelFor(m => m.Email) @Html.TextBoxFor(m => m.Email, new { @class = "form-control" }) @Html.ValidationMessageFor(m => m.Email, "", new { @class = "text-danger" })
</div>
@*
<input style="margin-left: auto; margin-right: auto; text-align: center;" type="email" class="form-control" name="email" />*@
</div>
<!-- Untuk Password-->
<div class="form-group form-material floating">
@Html.LabelFor(m => m.Password) @Html.PasswordFor(m => m.Password, new {@class= "form-control"}) @Html.ValidationMessageFor(m => m.Password, "", new { @class = "text-danger"}) @*
<input style="margin-left: auto; margin-right: auto; text-align: center;" type="password" class="form-control" name="password" />*@
</div>
<div class="form-group clearfix">
<div class="checkbox-custom checkbox-inline checkbox-primary checkbox-lg pull-left">
<input type="checkbox" id="inputCheckbox" name="remember" />
<label for="inputCheckbox">Remember me</label>
</div>
</div>
<button style="" class="btn btn-primary btn-block btn-lg" onclick="location.href='@Url.Action(" About ")'">Sign in</button>
</form>
</div>
</div>
}
<footer class="page-copyright page-copyright-inverse">
<p>© 2016. All RIGHT RESERVED.</p>
</footer>
</div>
</div>
</div>
<div class="col-sm-4">
</div>
@section Scripts { @Scripts.Render("~/bundles/jqueryval") }
这是我的代码:D,错误是Parser Error
答案 0 :(得分:0)
这适用于您的嵌套form
因为你已经在html div中引入了一个表单
@using (Html.BeginForm("Login", "Account", new { ReturnUrl = ViewBag.ReturnUrl }, FormMethod.Post, new { @class = "form-horizontal", role = "form"})) { @Html.AntiForgeryToken()
........
并尝试以相同的形式介绍另一个form
<form method="post" action="customer_search.php" autocomplete="off">
......