我試圖剃刀添加到我的HTML,但現在我得到一個分析器錯誤,不明白爲什麼我得到這個錯誤:獲取分析器錯誤時,將剃刀HTML
HTML:
@model ServingTeam.DAL.Members
@{
ViewBag.Title = "New Member";
Layout = "~/Views/Shared/_Layout.cshtml";
}
@using (Html.BeginForm("AddMember", "Home", new { ReturnUrl = ViewBag.ReturnUrl }, FormMethod.Post, new { role = "form" }))
{
<div class="row">
<div class="col-md-2">
</div>
<div class="col-sm-6">
<h2>
New Member</h2>
<form class="form-horizontal" role="form" id="memberForm">
<div class="form-group">
<label for="inputName" class="col-sm-2 control-label" />
Name</label>
<div class="col-sm-10">
@Html.TextBoxFor(m => m.Email, new { @class = "form-control", placeholder = "Name", type = "text", required = "required " })
</div>
</div>
<div class="form-group">
<label for="inputName" class="col-sm-2 control-label">
Surname</label>
<div class="col-sm-10">
@Html.TextBoxFor(m => m.Surname, new { @class = "form-control", placeholder = "Surname", type = "text", required = "required " })
</div>
</div>
<div class="form-group">
<label for="inputName" class="col-sm-2 control-label">
Cell</label>
<div class="col-sm-10">
@Html.TextBoxFor(m => m.Cell, new { @class = "form-control", placeholder = "Cell", type = "text" })
</div>
</div>
<div class="form-group">
<label for="inputEmail3" class="col-sm-2 control-label">
Email</label>
<div class="col-sm-10">
@Html.TextBoxFor(m => m.Email, new { @class = "form-control", placeholder = "Enter email address", type = "email", required = "required " })
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-info">
Submit</button>
</div>
</div>
</form>
</div>
<div class="col-md-4">
</div>
</div>
}
@section Scripts {
@Scripts.Render("~/bundles/jqueryval")
}
<script>
$("#memberForm").validate();
</script>
這是我得到的錯誤: 遭遇結束標記「div」,沒有匹配的開始標記。您的開始/結束標籤是否適當平衡?所有工作正常,當我刪除剃刀。
請幫忙嗎?
你確定錯誤不在佈局文件中嗎? – thsorens
即使使用Razor,我的其他網頁也不會有問題 – Gericke