How do you execute the autopostback function for web forms in asp.net mvc?

I have a simple webgrid that displays a list. I also have a combobox that contains several elements. I want that when the user changes the selection, the changed value should be sent to the server. How can i do this?

Any snippets of code will be helpful.

Thanks in advance:)

0
source share
2 answers

Automatic postback in Web Forms was done using some JavaScript. It's not out of the box in MVC, but simple enough to do it yourself.

Assuming you have jQuery:

$(document).ready(function() {
    $('#someCheckBox').change(function() {
        $('#yourFormId').submit();
    });
});

"" , -; " " someCheckBox " , " yourFormId ". , , .

- , AJAX -, , . :

 $(document).ready(function() {
    $('#someCheckBox').change(function() {
        $.ajax(/*make an AJAX call*/);
    });
});
+6

ajax javascript

0

All Articles