I have a simple webgrid which displays list. I also have a combobox which contains few items. I want that when user changes the selection, the changed value should be posted to the server. How can I do this?
Any code snippets would be helpful.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Auto-postback in Web Forms was accomplished with some JavaScript. This is not out-of-the-box in MVC, but simple enough to do on your own.
Assuming you have jQuery:
This is “closest” to how classic Web-Forms work; basically does “When a checkbox with the ID of ‘someCheckBox’ is checked or unchecked, submit the form with id ‘yourFormId’. You can of course change this to your needs.
This wasn’t included out-of-the-box due to most developers favoring AJAX calls instead of full-blown post-backs, which I would encourage you to do if possible. What might be more preferable is: