473,804 Members | 2,112 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 RequiredFieldVa lidtors, some are Regex etc.

here's some of my code:
<asp:FormView ID="fvRegDetail " runat="server" DefaultMode="Ed it"
DataKeyNames="R egistrantId" DataSourceID="o dsRegistrant"
CssClass="waFor mView" >
......
<EditItemTempla te>
<asp:TextBox ID="tbWArrival " Text='<%# Bind("WArrival" )
%>' ReadOnly="false " runat="server" CssClass="waTex tBox" MaxLength="6"
Width="64px"></asp:TextBox>
<asp:RequiredFi eldValidator
ID="RequiredFie ldValidator11" runat="server"
ErrorMessage="A rrival time is required"
ValidationGroup ="regForm"
SetFocusOnError ="true"
ControlToValida te="tbWArrival" ><img src="~/images/bangs.gif" title="required "
/></asp:RequiredFie ldValidator>
....
<asp:Validation Summary ID="ValidationS ummary1" runat="server"
ValidationGroup ="regForm" ShowMessageBox= "true" ShowSummary="fa lse"
HeaderText="Ple ase review the following errors:"/>

<asp:Button ID="UpdateButto n" runat="server" CausesValidatio n="True"
CommandName="Up date" Text="Update" ValidationGroup ="RegForm">
</asp:Button>

</EditItemTemplat e>
</asp:FormView>

Any ideas on why this isn't working would be appreciated
Apr 9 '06 #1
2 2029
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
2095
by: nate | last post by:
the error returned is this: Server Error in '/AnnAccRpt' Application. -------------------------------------------------------------------------------- Could not find control 'DropDownList1' in ControlParameter 'DropDownList1'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
3
3168
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 Bind() can only be used in the context of a databound control. Any help with this would be appreciated. -- Thanks in advance,
2
9902
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 longer but this should illustrate the problem: <asp:FormView ID="bookFormView" runat="server" DataSourceID="bookSqlDataSource"> <ItemTemplate> <asp:textBox id="name" text='<%# Eval("name") %>'
3
4517
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 inserting, I want to send the data via email, the problem is how do I do that?
5
6909
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 load ViewState" exception when a mode change occurs. Is this correct? If so, it would appear to defeat the >>entire point<< of being able to use customized templates for the various modes. Assuming this limitation exists, what's the...
1
6122
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 buttons which call some code to changed the formview mode from Edit to ReadOnly or vice versa. When I run the code though and click the link buttons, the formview doesn't switch modes (the page reloads the mode just doesn't change) Here is the code...
0
284
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 am guessing on the postback the user control is setting the form back to ReadOnly. I got around this by triggering the update in the formview from a button using the updateitem method but changing the mode of the form to edit beforehand. This...
0
1840
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 button etc) and a dataset to provide the data to populate these fields. I'm tring to do this using composite controls. I would have a control to display a single record (formview), another control to display a grid of records (datasheet), another...
1
2157
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
9712
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9594
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10595
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10343
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10341
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10089
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9171
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
2
3831
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3001
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.