验证摘要中的验证错误 [英] Validation Errors in Validation Summary only
本文介绍了验证摘要中的验证错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好,
热烈的问候!
我正在使用范围验证器,必填字段验证器和其他人并相应地获取错误消息。当我试图将它们全部放在验证摘要中时,它确实有效,但错误也在验证器位置显示,我的意思是它们会重复。请问如何仅在验证摘要中显示错误,从而减轻来自不同验证器的所有单独错误消息?
B.Rgds,
Sunny
Hi there,
Warm Greetings!
I'm using Range validator, Required field validator & others and getting the error messages accordingly. When I'm trying to put them all in a validation summary it does work but the errors are are also being shown on the validator places, I mean they get repeated. Please how can I show errors only in Validation Summary mitigating all the separate error messages from different validators ?
B.Rgds,
Sunny
推荐答案
试试这个链接
http://www.aspxcode.net /free-asp-net-validation-source-code.aspx?Topics=How%20to%20Use%20ValidationSummary [ ^ ]
简单!在Validator标记中设置显示=无:
Simple ! Set Display="None" in the Validator tag as:
<p> Name :
<asp:TextBox ID="txtName" runat="server" />
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="you still no add the name !" Display="None" ControlToValidate="txtName"></asp:RequiredFieldValidator>
</p>
和验证摘要为:
and Validation summary as:
<asp:ValidationSummary ID="ValidationSummary1" runat="server" HeaderText="the all error that meet to is : "></asp:ValidationSummary>
显示=无是诀窍。
这篇关于验证摘要中的验证错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文