asp.net 4.5 webforms model binding : client side validation supported?

后端 未结 2 1273
不思量自难忘°
不思量自难忘° 2021-02-10 04:01

I\'m a huge fan of asp.net 4.5 webforms model binding using data annotations.

ascx:

     

        
2条回答
  •  情话喂你
    2021-02-10 04:22

    Guys webforms have complete client side validation, it just needs to be specified once in the model, that's the whole point of Model Binding and DataAnnotations check these links below. In short Add the following reference to your Model class library project. using System.ComponentModel.DataAnnotations;

    Add this line to your web.config

    
    

    Follow this link for details Webforms Model Validation

    And this link for Microsoft's complete documentation Microsoft documentaion

提交回复
热议问题