本文介绍了我使用ValidationSummary服务器控件来弹出错误,但它无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
<div>
<asp:ValidationSummary ID="ValidationSummary2" runat="server" ShowMessageBox="true" ShowSummary="False" HeaderText="Summary" EnableClientScript="True" />
<table id="tbl1" runat="server">
<tr>
<td>class
<br />
<asp:Label runat="server" ID="lbl1"></asp:Label>
<asp:DropDownList runat="server" ID="ddlClass" Width="300px" />
<asp:RequiredFieldValidator ID="rfvClass" runat="server" ControlToValidate="ddlClass" Display="None" ErrorMessage="select class" InitialValue="0"></asp:RequiredFieldValidator>
</td>
<td>abc<br />
<asp:Label runat="server" ID="lblabc"></asp:Label>
<asp:TextBox runat="server" ID="txtabc" Rows="3" TextMode="MultiLine" Width="450"></asp:TextBox>
<asp:Label runat="server" Text="*" ForeColor="Red"></asp:Label>
<asp:RequiredFieldValidator ID="rfvscope" ControlToValidate="txtabc" Display="None" ErrorMessage="enter the values" runat="server" ></asp:RequiredFieldValidator>
</td>
</tr>
</table>
</div>
推荐答案
这篇关于我使用ValidationSummary服务器控件来弹出错误,但它无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!