validator control not triggering in formview

G

Guest

I have a FormView with lots of field that have validators attached but none
of them are working. Most are RequiredFieldValidtors, some are Regex etc.

here's some of my code:
<asp:FormView ID="fvRegDetail" runat="server" DefaultMode="Edit"
DataKeyNames="RegistrantId" DataSourceID="odsRegistrant"
CssClass="waFormView" >
......
<EditItemTemplate>
<asp:TextBox ID="tbWArrival" Text='<%# Bind("WArrival")
%>' ReadOnly="false" runat="server" CssClass="waTextBox" MaxLength="6"
Width="64px"></asp:TextBox>
<asp:RequiredFieldValidator
ID="RequiredFieldValidator11" runat="server"
ErrorMessage="Arrival time is required"
ValidationGroup="regForm"
SetFocusOnError="true"
ControlToValidate="tbWArrival"><img src="~/images/bangs.gif" title="required"
/></asp:RequiredFieldValidator>
....
<asp:ValidationSummary ID="ValidationSummary1" runat="server"
ValidationGroup="regForm" ShowMessageBox="true" ShowSummary="false"
HeaderText="Please review the following errors:"/>

<asp:Button ID="UpdateButton" runat="server" CausesValidation="True"
CommandName="Update" Text="Update" ValidationGroup="RegForm">
</asp:Button>

</EditItemTemplate>
</asp:FormView>

Any ideas on why this isn't working would be appreciated
 
C

cormactobrien

is your formview within another control that is hidden when the page is
loaded?
i had a formview within a Panel. The panel was visible='False' and only
shown in the Page_PreRender if it was required. Because of this none of
the validation controls ever ran. It seems that server side validation
is only run on controls that are visible when the validation is run,
which is after Page_Load and before Page_PreRender.
 
G

Guest

thanks, I solved this a long time ago, but can't remember what the problem
was, there have been so many since ;)
 

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

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top