Need to update the check box value to db table when i click the checkbox() without post back in MVC2

后端 未结 3 1125
萌比男神i
萌比男神i 2021-01-27 06:40



3条回答
  •  逝去的感伤
    2021-01-27 07:05

    $('#checkboxid').click(function(){
     $.ajax({ url: 'your_url_for_receiving_data',
    type: 'POST',
    data: { checkbox: $('#checkboxid').attr('checked') },
    success: function(o) { alert('saved'); }
    });
    

    just create code behind in mvc2 where you will get value from request and save it to db

提交回复
热议问题