I have follwoing code
@Html.DropDownList("optionsforuser", new SelectList(new[] { "Option1", "Option2" }), "Select")
Now i want to call a method from controller passing it whatever option user has selected. Any ideas how this could be done?
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.
Since MVC 3 comes with jQuery as it’s javascript library of choice, you could do the following for a full page post:
Or if you wish to go asynchronous:
Update
Or asynchronous with a callback on complete: