Validation messages not displaying

Discussion in 'ASP .Net Web Controls' started by ann, Jun 26, 2006.

  1. ann

    ann Guest

    I am using a required field validator and a validator summary for a datagrid.
    On the update, I check for isvalid against the required - which works fine.
    My problem is that when not valid, neither the val.summary message or my *
    next to the required field appears. I can see them in design ...
    Anyone have any idea what I might be doing wrong?
    <asp:validationsummary id="valSummary" Width="253px" Height="32px"
    Font-Size="Smaller" DisplayMode="List"ShowSummary="True" HeaderText="<b>The
    following errors were found:</b>" Runat="server"></asp:validationsummary>

    <asp:requiredfieldvalidator id="Requiredfieldvalidator1" Runat="server"
    ControlToValidate="txtTransDate" ErrorMessage="* Transaction Date must be in
    the form of mm/dd/yy"Display="dynamic">*</asp:requiredfieldvalidator>
    ann, Jun 26, 2006
    #1
    1. Advertising

  2. Hi Ann,

    I think you have some text where it isn't allowed. The code below works for
    me.

    Ken
    Microsoft MVP [ASP.NET]

    <%@ page language="VB" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <script runat="server">

    </script>

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
    <title>Error test</title>
    </head>
    <body>
    <form id="form1" runat="server">
    <div>
    <asp:validationsummary runat="server" id="valSummary"
    displaymode="List" font-size="Smaller" headertext=""
    height="32px" showsummary="True" width="253px">
    </asp:validationsummary>
    <asp:textbox id="txtTransDate" runat="server">
    </asp:textbox>
    <asp:requiredfieldvalidator id="Requiredfieldvalidator1"
    runat="server" controltovalidate="txtTransDate"
    display="dynamic"
    errormessage="* Transaction Date must be in the form of
    mm/dd/yy">*
    </asp:requiredfieldvalidator>
    <br />
    <br />
    <asp:button id="Button1" runat="server" text="Button" /></div>
    </form>
    </body>
    </html>


    "ann" <> wrote in message
    news:...
    >I am using a required field validator and a validator summary for a
    >datagrid.
    > On the update, I check for isvalid against the required - which works
    > fine.
    > My problem is that when not valid, neither the val.summary message or my *
    > next to the required field appears. I can see them in design ...
    > Anyone have any idea what I might be doing wrong?
    > <asp:validationsummary id="valSummary" Width="253px" Height="32px"
    > Font-Size="Smaller" DisplayMode="List"ShowSummary="True"
    > HeaderText="<b>The
    > following errors were found:</b>" Runat="server"></asp:validationsummary>
    >
    > <asp:requiredfieldvalidator id="Requiredfieldvalidator1" Runat="server"
    > ControlToValidate="txtTransDate" ErrorMessage="* Transaction Date must be
    > in
    > the form of mm/dd/yy"Display="dynamic">*</asp:requiredfieldvalidator>
    Ken Cox [Microsoft MVP], Jun 27, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Thomas Connolly

    Validation Summary not showing error messages

    Thomas Connolly, Jul 9, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    672
    Thomas Connolly
    Jul 9, 2003
  2. Teemu Keiski
    Replies:
    0
    Views:
    505
    Teemu Keiski
    Jul 9, 2003
  3. Lucas Tam
    Replies:
    2
    Views:
    1,104
    Lucas Tam
    Feb 26, 2004
  4. =?Utf-8?B?SXJmYW4gQWtyYW0=?=

    Displaying warning messages...

    =?Utf-8?B?SXJmYW4gQWtyYW0=?=, Dec 27, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    694
    =?Utf-8?B?SXJmYW4gQWtyYW0=?=
    Dec 27, 2004
  5. PC Leung
    Replies:
    1
    Views:
    442
    Murray
    Jul 9, 2004
Loading...

Share This Page