Question

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...

Was it helpful?

Solution

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"/>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top