Mvc.remote Verify that the user name is duplicated

Source: Internet
Author: User

That's what the Model says.

1[Display (Name ="User name")]2[Required (errormessage ="please fill in {0}")]3[Stringlength ( -, Minimumlength =6, errormessage ="{0} length must be greater than {2} bit less than {1} bits")]4[System.Web.Mvc.Remote ("Checksellernick","Login", errormessage ="user account already exists")]
public string Loginno {get; set;}
Controller 里面这样写的
1[OutputCache (location = outputcachelocation.none, Nostore =true)]//Clear Cache2      PublicJsonresult Checksellernick (stringLoginno)3       {    4         //bool exists = _userservice.loginnoexist (Loginno);5           BOOLexists = Loginno.equals ("111111") ?true:false;6         returnJson (exists, jsonrequestbehavior.allowget);7}

That's what the View says.

1      New " Register_input " "  - " ,  }) 2 3 class="register_error"> @Html. validationmessagefor (o = O. Loginno) </div>

Mvc.remote Verify that the user name is duplicated

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.