How do you submit a dropdownlist in asp.net mvc from an Ajax form

前端 未结 7 1743
自闭症患者
自闭症患者 2020-12-25 13:12

How do you submit from a dropdownlist \"onchange\" event from inside of an ajax form?

According to the following question: How do you submit a dropdownlist in asp.ne

7条回答
  •  被撕碎了的回忆
    2020-12-25 13:50

    What you can try to do it this (jQuery required):

    $("#yourDropdown").change(function() {
      var f = $("#yourForm");
      var action = f.attr("action");
      var serializedForm = f.serialize();
      $.post(action, serializedForm,
        function () { alert("Finished! Can do something here!") });
    });
    

提交回复
热议问题