【问题标题】:Validation Summary MessageBox not displaying验证摘要 MessageBox 未显示
【发布时间】:2018-01-23 18:27:35
【问题描述】:

我正在尝试在 MessageBox 中显示我的验证摘要,它只是在工作。这就是我所拥有的。

<asp:ValidationSummary ID="ValidationSummary1" runat="server" Height="24px" Width="100%"ShowMessageBox="True" ShowSummary="False"></asp:ValidationSummary>

<tr>
  <td align="right">
    <asp:Label ID="Label2" runat="server" CssClass="label" Width="138px">* Serial Number</asp:Label>
 </td>
 <td>
   <asp:TextBox ID="txtSerial" runat="server" ></asp:TextBox>
   <asp:RequiredFieldValidator ID="valSerial" runat="server"
     ControlToValidate="txtSerial" ErrorMessage="Serial number is required" >*</asp:RequiredFieldValidator>
 </td>

<asp:Button ID="btnSubmit" runat="server" Text="Submit" Height="20px"></asp:Button>

我遵循了我在互联网上可以找到的所有指南,但我无法让它发挥作用。 我错过了什么?谢谢!

【问题讨论】:

  • 它在这里工作。(在我在WidthShowMessageBox 之间放置一个空格之后,但无论如何这应该会产生解析器错误)。我建议你检查你的浏览器控制台是否有 javascript/jQuery 错误。
  • ShowSummary="False",不应该是真的吗?
  • @AmanB 不,不必如此。
  • 我的控制台没有显示页面的任何错误。这很奇怪。它与通过 IIS Express 运行页面有什么关系吗?无论如何感谢您的帮助。

标签: html asp.net vb.net


【解决方案1】:

我回答了。我的网络配置中有&lt;xhtmlConformance mode="Legacy" /&gt;。这阻止了 MessageBox 的显示。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-05-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-03-15
    相关资源
    最近更新 更多