MVC Membership Registration

Source: Internet
Author: User

Since the writing of "database data encryption and decryption" http://www.cnblogs.com/insus/p/3434735.html. It also mentions Insus.net's ability to implement membership registration in an MVC application.
For some time, the work is busy, the star six is also on duty. Now is a sneak in, continue to write the MVC program.
This secondary implementation of membership registration function, from the simplest to start.
In the database, create a membership table [Member]


Note The data type of the password field, which is converted to binary since the password is encrypted. For encryption, you can join the link at the beginning of the article.
Next, complete the registered stored procedure [dbo]. [Usp_member_register]:

When writing stored procedures, pay attention to the password data type. The user input must be a character type, but not a binary type.
Now we can go to the MVC application and create a model:



Create an entity to communicate with the database.

Also create a controller:



After creating the controller MemberController.cs, in MVC5, it automatically creates a member directory under the Views directory. Next, of course, is to create a REGISTER.CSHTMLL view:



No style, no validation. Just a few basic text boxes. Finally, we need to complete the data submission function and write jquery Ajax:



Real-time Operation Demo:



The following is a record of the data:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.