ASP. net mvc uses jQuery to POST data to the database, mvcjquery
Learn ASP. net mvc program, combine jQuery client code, and Post data to the database. Insus. NET writes an example of integrity today.
In the database, create a table [dbo]. [TestUser]:
Since data is stored in the database, you must first create a stored procedure [dbo]. [usp_TestUser_Insert] in the database:
Program and database connection and logical processing, using this http://www.cnblogs.com/insus/archive/2010/01/23/1654653.html
In MVC, you need to create a model Insus. NET. Models. TestUser:
Next, create an entity Insus. NET. Entities. TestUserEntity:
The Controller MarchY15Contoller adds a view operation PostDataToDataBase ():
Create View:
Before implementing jQuery code, you have to go back to the Controller and write a PostData operation method.
Now we can write JQuery code:
Demo:
Including this article and all previous ASP. net mvc, jQuery source code and database:
Http://download.cnblogs.com/insus/MVC/InsusMVCSiteCS20150306.rar