且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Ajax.BeginForm没有更新目标div

更新时间:2023-02-11 18:54:20

('#myModal1')。modal('hide');}))

{}





型号:





('#myModal1').modal('hide');" }))
{}


Model:


public JsonResult AddBranchContact(BranchViewModel objBranchContact)
     {
      List<BranchContact> BranchContactList = new List<BranchContact>();
         if (Session["BranchContactList"] == null)
         {
             BranchContactList.Add(objBranchContact.BranchContactDetails);
             Session["BranchContactList"] = BranchContactList;
         }
         else
         {
         } 
         return Json(BranchContactList, JsonRequestBehavior.AllowGet);
     }





查看:





View:

@using (Html.BeginForm())
{

<div id="section3"><table>


</table></div>

The results returned from the action below are displayed in tr tds of this table. But when the action method below is called it gets the data but doesnt come back to this part : @using(Html.BeginFOrm()) even though i have given the UpdateTargetID as above.
}


在我看来,你正试图混合Ajax.BeginForm和Html.BeginForm。 Yout代码应该没有@ Html.Beginform块。尝试使用此代码而不使用此块。
It seems to me, You are trying to mix Ajax.BeginForm and Html.BeginForm. Yout code should work without @Html.Beginform block. Try to use this code without this block.