Click here to Skip to main content
15,885,767 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have Class UserEntity
with validation

C#
 public class UserEntity
    {


        public Int64? UID { get; set; }

        [Required]
        [Display(Name = "Customer Name")]
      
        public string Name { get; set; }
        [Required]
        [Display(Name = "User Name/ Mobile Number")]
        [RegularExpression("^[0-9]{10}$", ErrorMessage = "User Name Should be 10 digit Mobile No")]

        [Remote("IsUserAvailable", "Login", AdditionalFields = "UID")]
        public string UserName { get; set; }
        [Required]
        [Display(Name = "Password")]
        public string Password { get; set; }
        [Required]
        [Display(Name = "Confirm Password")]
        [Compare("Password", ErrorMessage = "The password and confirmation password do not match.")]

}


it working fine with Registration Form but in Login i want to disable all validation

tried
HTML
@Html.EditorFor(model => model.BatchId, new {@class = "k-textbox", data_val = false})
Posted
Updated 4-Apr-14 3:01am
v2

1 solution

Hello,

Please have a look at this[^] article.

Regards,
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900