Validation messages not displaying

A

ann

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

Ken Cox [Microsoft MVP]

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>
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top