我创建了一个 Ajax 表单,例如:
@using (Ajax.BeginForm("myaction", "mycontroller", new AjaxOptions
{
UpdateTargetId = "result",
HttpMethod = "POST",
OnSuccess = "success"
}, new { @id = "myForm" }))
{
@Html.ValidationSummary(true)
<div class="editor-label">
@Html.LabelFor(model => model.autoadvertfilter.Manufacturer)
</div>
<div class="editor-field">
@Html.DropDownListFor(model => model.autoadvertfilter.Manufacturer, (SelectList)ViewBag.Mfr, "--Select--")
@Html.ValidationMessageFor(model => model.autoadvertfilter.Manufacturer)
</div>
<p>
<input type="submit" value="Go" />
</p>
}
当我提交此表单时,它会重置。我希望此表单即使在成功提交后也能保留这些值。任何建议,将不胜感激。