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

后端 未结 2 2037
我在风中等你
我在风中等你 2021-02-10 04:04

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

ascx:

     

        
2条回答
  •  一个人的身影
    2021-02-10 04:25

    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

提交回复
热议问题