|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Validation messages not displayingI 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> 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> Show quoteHide quote "ann" <a**@discussions.microsoft.com> wrote in message news:2C469811-211C-45FB-BE69-408B2B3557F0@microsoft.com... >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>
Other interesting topics
changing cursor of ImageButton
TextBox TextChanged Event Adding WebControl using a Button.... Custom Controls with non-String Attributes Responding to changes to controls in a Repeater Dynamically Creating A CSS Class Response.Redirect not being called after sending an email Bitmap as a Image web control How to use gridview asp.net 1.1 X 2.0 compatibility issue |
|||||||||||||||||||||||