验证控件的错误应该在同一个地方显示? [英] Error of validation control should be diaplay in same place?

查看:61
本文介绍了验证控件的错误应该在同一个地方显示?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有验证控件,显示错误,如

请输入数字手机号码应为10位数

我希望它显示为

请输入数字

手机号码应为10位

i have validation control whoch display error like
"Please Enter Number" "Mobile Number Should be 10 digit"
I want it display like
"Please Enter Number"
"Mobile Number Should be 10 digit"

推荐答案

是否要在两个显示错误信息line ....只需在两个验证控件之间添加br html标签..如果此消息是两个差异验证控件...
一个验证控件的
在ErrorMessage中添加br

即exa ...

do you want to display error message in two line....just add br html tag between two validation controls.. if this messages are of two diff validation control...
for one validation control add br in ErrorMessage
i.e exa...
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"

            ControlToValidate="TextBox1" ErrorMessage="Enter number<br/>Mobile no"></asp:RequiredFieldValidator>


使用必填字段验证器和正则表达式。你会得到它



http://forums.asp。 net / t / 1070986.aspx [ ^ ]





http://www.dotnetexpertsforum.com/regular-expression-for-10-digit-mobile-number-in-asp-net-t1307.html [ ^ ]



希望这些链接可以帮助你。:)
Use required field validator and regular expression. you will get it

http://forums.asp.net/t/1070986.aspx[^]


http://www.dotnetexpertsforum.com/regular-expression-for-10-digit-mobile-number-in-asp-net-t1307.html[^]

hope these links help u.:)


这篇关于验证控件的错误应该在同一个地方显示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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