I’m woondring how to insert data into my DataBase using Ajax in ASP.net MVC. Exactly i want when user click on Add new item, a Popup is shown where user wil put some data And a Ok Onclick This will add the iserted Data and close this popup or show error Message.
I’m using Data entity Framework. And sorry for this Question but i’m biginner at ASP.net MVc and Ajax so Please any help or Tuto link that will be nice 🙂
I’m woondring how to insert data into my DataBase using Ajax in ASP.net MVC.
Share
You might want to have a look at asp.net webapi which is built into asp.net MVC 4.
you don’t have to use that, but it is a nice way to do Ajaxy stuff. However, the basic idea is you GET/POST (using something like .post or .get in jquery) to an action (basically a URL). That action then takes care of storing things to a database.
You’ll want to learn about model binding and json…. thats the ability for asp.mvc to convert your C# objects to and from JSON
You’ll want to go and look at a number of asp.net mvc example apps, like nerd dinner, for examples of MVC and ajax…..