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.
Asked
Active
Viewed 77 times
0
-
Are you using ASP.NET MVC – Satpal Apr 12 '13 at 10:30
-
yes i am mvc3 with c# – user2169717 Apr 12 '13 at 10:41
-
look here http://stackoverflow.com/questions/5410055/using-ajax-beginform-with-asp-net-mvc-3-razor – polybios Apr 12 '13 at 11:05
1 Answers
1
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.

Prince
- 308
- 1
- 2
- 11