I am using ASP.NET MVC 2. I have a modal dialog (done through jquery UI) that contains two text boxes and a button. All the controls are inside a form.
I would like to invoke, when the user click the button, a controller action that do some operations on the passed data contained in the two text boxes and then return an integer value and a string message to the user.
Could anybody provide an example for doing this with jquery?
Thanks so much!
suppose you have the following form :
using jQuery
});
Accessing Your Data in the Action Method.
another way is to use Microsoft Ajax
UpdateTargetIdis the id of the html element to be targeted.The InsertionMode option has three values
Replace,InsertAfter,InsertBeforeHope that was helpful
Update : you don’t have to return a Json result in your action method you can simply return a partial view or any HTML code as the response object and then insert it using jQuery.