我使用asp mvc我有一个表单并且我编辑了这个表单的一些,但是在编辑之后,更改将不会出现,直到我重新运行,我看我如何刷新这部分编辑我的表单,这是我的代码:
控制器:
[HttpPost]
public ActionResult EditParticipant(GetParticipantModel model)
{
model.FillDDL();
if (ModelState.IsValid)
{
model.EditParticipant();
}
return RedirectToAction("_ParticipantDetail", model);
}
观点:
@using (Ajax.BeginForm("EditParticipant", "GetParticipant",
new AjaxOptions {
HttpMethod="POST",
OnComplete = "flipCard_1(jQuery(this), 0);"
}))
{
@Html.HiddenFor(m=>m.Participants.StateCDR)
@Html.HiddenFor(m => m.Participants.StartDate)
@Html.HiddenFor(m => m.Participants.EndDate)
@Html.HiddenFor(m => m.Participants.FinancialGroup)
@Html.HiddenFor(m => m.Participants.Insurance)
@Html.HiddenFor(m => m.Participants.Active)
<div class="fsc-card-body-fixed">
<div class="fsc-card-container-3">
<div class="fsc-comp-infobox-2">
<div class="row">
<div class="col-xs-2">
<label class="fsc-label-1">Code du Participant</label>
@Html.EditorFor(m => m.Participants.ParticipantCode, new { htmlAttributes = new { @class = "form-control" } })
</div>
...............................
<button type="submit" class="btn btn-sm fsc-btn-3" >
<i class="fa fa-save"></i>
<span>Enregistrer</span>
</button>
}