|
<form id="form1" runat="server">
<asp:ValidationSummary ID="valSum" runat="server"
DisplayMode="List"
Font-Name="verdana"
Font-Size="12" EnableClientScript="False" ValidationGroup="gp1"
/>
<br />
<asp:TextBox ID="TextBox1" runat="server" ValidationGroup="gp1"></asp:TextBox><asp:RequiredFieldValidator
ID="RequiredFieldValidator1"
runat="server"
ErrorMessage="error1"
Display="Dynamic"
Font-Size="12"
ControlToValidate="TextBox1" EnableClientScript="False" ValidationGroup="gp1">*
</asp:RequiredFieldValidator>
<br />
<asp:TextBox ID="TextBox2" runat="server" ValidationGroup="gp1"></asp:TextBox><asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="TextBox2"
ErrorMessage="error2" EnableClientScript="False" ValidationGroup="gp1">*</asp:RequiredFieldValidator>
<br />
<br /><asp:Button ID="Button1" runat="server" Text="Button" ValidationGroup="gp1" CausesValidation="False" /><br />
<br />
<asp:ValidationSummary ID="ValidationSummary1" runat="server"
DisplayMode="List"
Font-Name="verdana"
Font-Size="12" EnableClientScript="False" ValidationGroup="gp2"
/>
<br />
<asp:TextBox ID="TextBox3" runat="server" ValidationGroup="gp2"></asp:TextBox><asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="TextBox3"
Display="Dynamic" EnableClientScript="False" ErrorMessage="error3" Font-Size="12" ValidationGroup="gp2">*
</asp:RequiredFieldValidator><br />
<br /><asp:Button ID="Button2" runat="server" Text="Button" ValidationGroup="gp2" /><br />
<br />
<br />
<asp:Button ID="Button3" runat="server" Text="Button" />
</form>
定义了2个Group
现在点击Button1做gp1的check
现在点击Button2做gp2的check
我现在想同时做gp1和gp2的check
但是message出在不同的ValidationSummary里面
怎么实现?
或者如果我不区分gp,同时做画面的所有check,如何得到check的错误信息自己在画面的不同区域表示 |
|