locked
Unobtrusive JavaScript Enabled RRS feed

  • Question

  • User1178889019 posted

    how to configure jquery validation client mode in app settings?

    Tuesday, August 28, 2018 12:01 PM

Answers

  • User-369506445 posted

    hi

    first set below tags in your web config 

    <appSettings>
        <add key="ClientValidationEnabled" value="true" />
        <add key="UnobtrusiveJavaScriptEnabled" value="true" />
    </appSettings>

    then  add below jquery reference

        jquery.validate.js
        jquery.validate.unobtrusive.js
    

    next, add the attribute for your properties

            [Required]  
            [EmailAddress]  
            [Display(Name = "Email")]  
            public string Email { get; set; }  

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, August 28, 2018 12:09 PM

All replies

  • User-369506445 posted

    hi

    first set below tags in your web config 

    <appSettings>
        <add key="ClientValidationEnabled" value="true" />
        <add key="UnobtrusiveJavaScriptEnabled" value="true" />
    </appSettings>

    then  add below jquery reference

        jquery.validate.js
        jquery.validate.unobtrusive.js
    

    next, add the attribute for your properties

            [Required]  
            [EmailAddress]  
            [Display(Name = "Email")]  
            public string Email { get; set; }  

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, August 28, 2018 12:09 PM
  • User-1171043462 posted

    Refer

    Enable Client Side validation in ASP.Net MVC

    For complete explanation step by step and example

    Tuesday, August 28, 2018 1:41 PM