我正在尝试重新创建现有登录表单的 HTML 设计以用于 MVC4 程序。这大部分都很好,但是当我尝试在两个元素之间输入管道字符( | )时,它会引发错误“意外标记”。您可以在底部、按钮之后和锚点之前看到它。任何想法为什么这是一个错误?有没有办法解决它?(除了删除管道字符?)
@using (Html.BeginForm("Login", "AccountController", new { ReturnUrl = ViewBag.ReturnUrl }, FormMethod.Post, new { @class = "form-login form-wrapper form-narrow" }))
{
@Html.AntiForgeryToken()
@Html.ValidationSummary(true)
<h3 class="title-divider"><span>Login</span> <small>Not signed up? @Html.ActionLink("Sign Up Here.", "Register")</small></h3>
@Html.LabelFor(m => m.UserName)
@Html.TextBoxFor(m => m.UserName, new { @class = "input-block-level" } )
@Html.ValidationMessageFor(m => m.UserName)
@Html.LabelFor(m => m.Password)
@Html.PasswordFor(m => m.Password, new { @class = "input-block-level" })
@Html.ValidationMessageFor(m => m.Password)
@Html.LabelFor(m => m.RememberMe, new { @class = "checkbox" })
@Html.CheckBoxFor(m => m.RememberMe)
<button class="btn btn-primary" type="submit" value="Log in" >Sign in</button>
| <a href="#">Forgotten Password?</a>
}