我使用ValidationSummary服务器控件来弹出错误,但它无法正常工作 [英] I used ValidationSummary server control for error pop up,but it is not working

查看:65
本文介绍了我使用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>

推荐答案

您的ShowSummary属性设置为False。如果要查看所有验证错误的摘要,则应将其设置为true。
Your ShowSummary attribute is set to False. It should be set to true if you want to see the summary of all validation errors.


这篇关于我使用ValidationSummary服务器控件来弹出错误,但它无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆