asp.net中的自定义验证和比较验证 [英] Custom Validation and Compare validation in asp.net

查看:94
本文介绍了asp.net中的自定义验证和比较验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿朋友,

在我的项目中我想使用以下验证控件。

控件是:

1.日期范围比较使用范围验证器。

2.Decimal验证和数字验证,它能够接受加号(+),减号( - ),连字符( - ),并且在十进制验证值中必须限制最多三个小数为(12.123)。

如果您有任何建议可以帮助我。

Hey friends,
In my project i want to use following validation controls.
The controls are:
1.Date range comparison using range validator.
2.Decimal validation and Number validation which can able to accept plus(+),minus(-),hyphen(-),and in that decimal validation value must restrict up to three decimals as (12.123).
If you have any suggestions help me.

推荐答案

对于范围验证器,请参阅ASP.NET RangeValidator Control [ ^ ]并按照以下代码
For Range Validator refer ASP.NET RangeValidator Control[^] and follow this code
<asp:textbox id="txtPassword" runat="server" textmode="Password">
<asp:regularexpressionvalidator id="REV1" runat="server" errormessage="Password can only be between 6 to 15 characters.!">
ControlToValidate="txtPassword" ValidationExpression="[\s\S]{6,15}">



对于自定义验证器,请检查验证 - CustomValidator [ ^ ]和< a href =http://msdn.microsoft.com/en-us/library/system.web.ui.webc ontrols.customvalidator.aspx> CustomValidator类 [ ^ ]


这篇关于asp.net中的自定义验证和比较验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆