473,394 Members | 2,048 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

validator control not triggering in formview

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
Apr 9 '06 #1
2 2008
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.

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

"co***********@hotmail.com" wrote:
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.

May 3 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: nate | last post by:
the error returned is this: Server Error in '/AnnAccRpt' Application. -------------------------------------------------------------------------------- Could not find control 'DropDownList1' in...
3
by: sck10 | last post by:
Hello, I am trying to bind an arraylist to a FormView DropDownList control in the PreRender state. The error that I get is the following: Databinding methods such as Eval(), XPath(), and...
2
by: Ned Balzer | last post by:
I'm trying to create a formview bound to a sqldatasource, and use a stored procedure to insert data from the formview into several tables. I have some simplified code below, the real code is much...
3
by: YMPN | last post by:
Hi Everyone, I'm deen from Riyadh. Please do help me with some problem i have. I have this formview control setup to recieved inputs from user (textbox, dropdownlist, others). After...
5
by: Mark Olbert | last post by:
It appears that FormView controls require the >>exact<< same layout of controls and control types in the various templates in order to function properly. Failure to do so results in a "failure to...
1
by: Brad Baker | last post by:
I have created a usercontrol (ascx file) which contains a formview, inside of the formview I have an EditItemTemplate and an ItemTemplate. Both the EditItemTemplate and ItemTemplate have link...
0
by: Chris | last post by:
I have a formview within a user control bound to an objectdatasource. When my formview is in edit mode and I press update I get an error saying that the form must be in edit mode to do an update. I...
0
by: angiemc | last post by:
Hi, I have a question about AJAX and ASP.Net controls. I'm working on a system that requires pages to be generated dynamically based on XML to provide the layout (eg text boxes, dropdowns, save...
1
by: David C | last post by:
When I use a validator control on a FormView it takes up space when screen first displays. Is there any way to avoid this and only have it take up space when there is an error? Thanks. David
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.