继续上 25 号线<div id="ajaxDiv">
“div”元素未关闭。所有元素必须是自闭合的或具有匹配的结束标记。
任何想法为什么?SO上的其他答案都没有对我有用。
@model MvcMovie.Models.Vote
@{
ViewBag.Title = "Match";
}
<h2>Edit</h2>
<div>
@Ajax.BeginForm("submitVote", "vote", new AjaxOptions
{
HttpMethod = "POST",
InsertionMode = System.Web.Mvc.Ajax.InsertionMode.Replace,
UpdateTargetId = "ajaxDiv"
}
)
</div>
<div id="ajaxDiv">
@Html.AntiForgeryToken()
@Html.ValidationSummary(true)
<fieldset>
<legend>Vote</legend>
@Html.HiddenFor(model => model.ID)
<div class="editor-label">
@Html.LabelFor(model => model.Celeb1ID)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.Celeb1ID)
@Html.ValidationMessageFor(model => model.Celeb1ID)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.Celeb2ID)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.Celeb2ID)
@Html.ValidationMessageFor(model => model.Celeb2ID)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.Celeb1Votes)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.Celeb1Votes)
@Html.ValidationMessageFor(model => model.Celeb1Votes)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.Celeb2Votes)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.Celeb2Votes)
@Html.ValidationMessageFor(model => model.Celeb2Votes)
</div>
<p>
</fieldset>
<button type="submit" id="submitVote" name="button" value="v1">Vote Celeb 1</button>
<button type="submit" id="submitVote" name="button" value="v2">Vote Celeb 2</button>
</fieldset>
</div>
@section Scripts {
@Scripts.Render("~/bundles/jqueryval")
}