<div id="dvErrorMessagesProfile" style="padding-top:2px; margin: 0 auto; width:540px;">
<asp:ValidationSummary ID="ValidationSummary2" ClientIDMode="Static" runat="server"
ValidationGroup="vgProfile" />
<asp:RequiredFieldValidator ID="rfvFirstName" Display="none" runat="server"
ErrorMessage="<div class='error_box_login'>please enter first name.<a href='javascript:void(0);' onclick='hideValid(this);' class='error-cross'></a> </div>"
ControlToValidate="FirstName" SetFocusOnError="True" ValidationGroup="vgProfile"></asp:RequiredFieldValidator>
<asp:RequiredFieldValidator ID="rfvLastName" Display="none" runat="server"
ErrorMessage="<div class='error_box_login'>please enter last name.<a href='javascript:void(0);' onclick='hideValid(this);' class='error-cross'></a> </div>"
ControlToValidate="LastName" SetFocusOnError="True" ValidationGroup="vgProfile"></asp:RequiredFieldValidator>
<asp:RequiredFieldValidator ID="rfvAddressLine1" Display="none" runat="server"
ErrorMessage="<div class='error_box_login'>Please enter address line 1.<a href='javascript:void(0);' onclick='hideValid(this);' class='error-cross'></a> </div>"
ControlToValidate="AddressLine1" SetFocusOnError="True" ValidationGroup="vgProfile"></asp:RequiredFieldValidator>
<asp:RequiredFieldValidator ID="rfvCity" Display="none" runat="server"
ErrorMessage="<div class='error_box_login'>please enter city.<a href='javascript:void(0);' onclick='hideValid(this);' class='error-cross'></a> </div>"
ControlToValidate="City" SetFocusOnError="True" ValidationGroup="vgProfile"></asp:RequiredFieldValidator>
<asp:RequiredFieldValidator ID="rfvZip" Display="none" runat="server"
ErrorMessage="<div class='error_box_login'>please enter Zip.<a href='javascript:void(0);' onclick='hideValid(this);' class='error-cross'></a> </div>"
ControlToValidate="Zip" SetFocusOnError="True" ValidationGroup="vgProfile"></asp:RequiredFieldValidator>
我只想显示验证总结的第一条消息。意味着如果用户没有输入任何值,那么它只显示其他未显示的第一条消息等...
答案 0 :(得分:0)
ValidationSummary就是它的名字 - 验证摘要。我不知道任何预先构建的attritube或者让你选择要显示的消息的东西。
您的选项基本上很少