3

I have a problem with a web application using validation summary with the attribute "ShowMessageBox" = true. The problem is that the message box isn't showing and the code is pretty simple:

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">

  <div>
        <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
        <asp:CompareValidator ID="CompareValidator1" ValidationGroup="Group1" ControlToValidate="TextBox1" Type="Integer" Operator="DataTypeCheck" runat="server" ErrorMessage="CompareValidator"></asp:CompareValidator>
        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ValidationGroup="Group1" ControlToValidate="TextBox1" ErrorMessage="RequiredFieldValidator"></asp:RequiredFieldValidator>
        <asp:Button ID="Button1" ValidationGroup="Group1" runat="server" Text="Button" />
        <asp:ValidationSummary ID="ValidationSummary1" runat="server" ValidationGroup="Group1" ShowMessageBox="true" ShowSummary="false" EnableClientScript="true" />
    </div>
    </form>
</body>
</html>

I also tried the exactly same code in a test project and it works.

What I want to know if there something in the global.asax or the web.config that can prevent this popup from showing.

BTW: I it's an old application using .net 3.5 that I'm updating. So I don't know exactly what's in the web.config and the global.asax that's why I'm asking.

UPDATE : I tried to copy the web.config of the application in the Test application and it's not working so there's something in the web.config that prevent the messagebox from showing... I just need to know what it can be now...

Frederic
  • 33
  • 4
  • Do you get any Javascript errors? – SLaks Jan 09 '13 at 20:47
  • No I don't. That's actually the first thing I checked. – Frederic Jan 09 '13 at 20:51
  • Check (using the tools of whatever browser you're using) that you're loading the validation javascript. You might be getting a silent failure. – Ann L. Jan 09 '13 at 21:57
  • Check whether the controls are inside a update panel, Check with different browsers, any master pages? above code is working for sure. i think your actual page might be very different from above. So i can not think of an issue from above code and i don't think global.ascx or the web.config causing the issue. – chamara Jan 10 '13 at 04:11
  • Place the ValidationGroup="Group1" inside the textbox as let me know,if it works or not. – MahaSwetha Jan 10 '13 at 06:15
  • @Chamara No it's actually the page. I want to use the validation summary in another page but I need the test page to work fist. – Frederic Jan 10 '13 at 15:08
  • @AnnL. I tried it and there's no silent failiure – Frederic Jan 10 '13 at 15:09
  • @MahaSwetha I already tried that with no success – Frederic Jan 10 '13 at 15:10
  • Here's a thought: if you turn `ShowMessageBox` to false and `ShowSummary` to true, does that work? If it does, you've got a problem with the code that raises the dialog box (or with dialog boxes in general); if it doesn't, you have a problem with the client-side validation. This will at least tell you more about where the problem lies. – Ann L. Jan 10 '13 at 16:32

1 Answers1

1

I don't know what browser you're using, but I did find this post:

http://aspadvice.com/blogs/rbirkby/archive/2006/11/01/Client_2D00_side-validation-in-Firefox.aspx

Apparently using this line in web.config can disable client-side validation in Firefox, or at least in some versions of Firefox:

<xhtmlConformance mode="Legacy"/>
Ann L.
  • 13,760
  • 5
  • 35
  • 66