Learn the ASP. NET MVC program, combined with jquery client code, post data to the database. Insus.net writes today an example of completeness.
In the database, create a table [dbo]. [TestUser]:
Now that you have the data in the database, you have to create a stored procedure [dbo] in the database first. [Usp_testuser_insert]:
Program and database connection and logical processing, use 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:
Controller Marchy15contoller Add a view Operation Postdatatodatabase ():
To create a view:
Before implementing the jquery code, you have to go back to the controller and write a postdata operation method.
At this point we can write the jquery code:
Demonstrate:
Includes this and all previous ASP. NET Mvc,jquery source program code and database:
Http://download.cnblogs.com/insus/MVC/InsusMVCSiteCS20150306.rar
ASP. NET MVC uses jquery to post data to the database