开发者

What is a good server side validation library for .net?

开发者 https://www.devze.com 2023-03-13 23:46 出处:网络
I am trying to find a validation library to validate user input on the server side Basically, I would like to avoid the following code appearing 15-20 times per page :

I am trying to find a validation library to validate user input on the server side

Basically, I would like to avoid the following code appearing 15-20 times per page :

If Not String.IsNullorEmpty(txtDate.text) Then
    StrMsg.appendline("Please enter Date")
ElseIf Not IsDate(txtDate.text) Then
    StrMsg.appendl开发者_如何转开发ine("Date must be numeric")
End If

I want to do something like this :

StrMsg.AppendLine(ValidateField(txtDate, SQLDataType.Date, Required))

Does anything like this exist?


You can use built in Validation controls

User Input Validation

Validation controls

After you have configured validation controls, all you have to do is check

Page.IsValid
0

精彩评论

暂无评论...
验证码 换一张
取 消