user2169717
user2169717

Reputation: 113

using ajax to post to server of a partial view form

I am new at using ajax, I have to add the form data onto a post so that it can be added to the server. but the tricky part is that the form data is a partial view on a dialog box. i would like to know how i would be able to use ajax in order to get a hold of this data so that it can be put back on to a database.

Upvotes: 0

Views: 79

Answers (1)

Prince
Prince

Reputation: 328

make a function on click of a button in the dilog box Then un that function use $.Post({"Controller/Action", {Parameter List}}) where PArameter List will contain the values of controls Like

Parameter1=document.getelementbyid('Textbox1').value; so on ....

and make a action method in controller using [HTTPPost]

you can check syntax from here

http://www.codeproject.com/Articles/426765/post-and-get-in-MVC-Razor-JQuery

Please Click the answer as useful if it serves your problem.

Upvotes: 1

Related Questions