Get the App
SLTechnology News&Howtos  ›  Development  › 

How to implement Asp.Mvc 2.0 user client Authentication

Shulou Source: shulou.com Published: 2022-06-03 09:29:52 09月28日 Update

This article mainly explains "how to achieve Asp.Mvc 2.0 user client authentication". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to achieve Asp.Mvc 2.0 user client authentication".

First, let's take a look at the verification effect of the registration page.

The above verification mainly includes

1. User name cannot be empty

two。 Password cannot be empty, password length cannot be less than 5 digits

3. The confirmation password cannot be empty, the length of the confirmation password cannot be less than 5 digits, and the confirmation password must be the same as entered in the password text box

4. The mailbox format must be correct.

Here is the code to validate using the jquery.validate plug-in

[html] Registration page $(). Ready (function () {$("# form1"). Validate ({rules: {UserName: {required: true}, UserPwd: {required: true, minlength: 6}, ConfirPwd: {required: true, minlength: 6, equalTo: "# UserPwd"}, Email: {email: true}} Messages: {UserName: {required: "user name cannot be empty!"}, UserPwd: {required: "password cannot be empty!", minlength: jQuery.format ("password length cannot be less than {0} characters!")}, ConfirPwd: {required: "confirm password cannot be empty!", minlength: jQuery.format ("confirm password length cannot be less than {0} characters!") EqualTo: "two passwords are inconsistent!"}, Email: {email: "incorrect email input format!"}, onkeyup: false}) })

M.UserName)% > m.UserName)% > m.UserPwd)% > m.UserPwd)% > m.ConfirPwd)% > m.ConfirPwd)% > m.Email)% > m.Email)% >

$("# form1") .validate mainly includes two parts: rule rules and prompt messages.

For example

Rules: {UserName: {required:true},}

Text box input that indicates that ID is UserName cannot be empty.

Messages: {UserName: {required: "use ®? account name? no? can you use an empty?!"}

Give a prompt if the content of the text box indicating that ID is UserName is empty.

Thank you for your reading, the above is the content of "how to achieve Asp.Mvc 2.0 user client authentication". After the study of this article, I believe you have a deeper understanding of how to achieve Asp.Mvc 2.0 user client authentication, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Tags: Password authentication user customer client content length input text learning consistency information character format user name mailbox prompt code digits album Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi MariaDB Shulou Information Linux macOS