【问题标题】:How to show an ASP.NET validation message next to my Save button as well as next to the validated control?如何在我的保存按钮旁边以及经过验证的控件旁边显示 ASP.NET 验证消息?
【发布时间】:2012-08-01 10:54:34
【问题描述】:

当用户单击页面上的“保存”按钮时,我正在使用 asp CustomValidator 对一些控件执行客户端验证。但是,此页面很长,因此他们经常看不到验证失败的控件旁边显示的验证消息。我怎样才能在“保存”按钮旁边放置一条一般验证消息,例如'请解决上述验证错误',以便用户知道页面未提交的原因?

【问题讨论】:

  • 老兄去验证总结。

标签: c# asp.net .net validation customvalidator


【解决方案1】:

您可以使用Validation Summary 控件,您可以将其放在保存按钮附近,它将提供所有无效验证控件的摘要。

您可以使用以下规则对其进行定义:

<asp:ValidationSummary 
     id="programmaticID" 
     DisplayMode="BulletList | List | SingleParagraph" 
     EnableClientScript="true | false"
     ShowSummary="true | false"
     ShowMessageBox="true | false"                        
     HeaderText="You need to resolve the following issues before you are able to continue:"
     runat="server"/>

【讨论】:

    猜你喜欢
    • 2012-06-12
    • 2014-10-30
    • 1970-01-01
    • 2012-02-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多