how to use validation controls on FormView control?

Hi all,

 I searched the forum for a solution to my problem, but while many of you seem to have had similar problems, I couldn't solve my (I thought easy) problem.

 This is my setup:

I try to put a FormView control on my page where users can insert records into a database. All good, except that I want to add some Validation controls to my form, at least some RequiredField validators.

 I tried adding the controls in the InsertItem Template for starters, but that doesn't seem to work:

" Unable to find control id 'FirstNameTextBox' referenced by the 'ControlToValidate' property of 'RequiredFieldValidator1 "

 Who can tell me why the validation controls can't be linked easily like in a normal form here?

 

Thanks already for putting me in the right direction!

 

Joris
 



 


coming from PHP and stil not a .NET-fan ;)
0
jorre
10/12/2007 10:45:34 AM
asp.net.presentation-controls 72751 articles. 3 followers. Follow

1 Replies
783 Views

Similar Articles

[PageSpeed] 30

 Hello,

 The validation controls should work easily within the formview. There is no special naming or ID you need to grap, except for the ID in which you orginially named it. Double check the Spelling of the control and that you are referencing the right name from the right template. 

Hope this helps. If not, post your formview and ill take a look at it. 


www.hopeasp.net
0
CSharpSean
10/12/2007 12:11:07 PM
Reply:

Similar Artilces:

Using Validation controls with FormView control
Hello dears; Is  it possible to use validation controls with FormView or DetailsView controls during Edit mode? Such controls have no Error Events handlers to use and there textboxes have only TextChanged Event handlers which have no text property. Also how can i get the content of a cell in theFormView ? Thanks alot  VWD2005 The FormView control supports templates -- so you could add an ItemTemplate or EditTemplate to it, and absolutely put validation controls within there as well. Hope this helps, Scott Thanks Scott  VWD2005 Hello I know your busy but I can'...

Controlling the controls a validator validates
Hello, I want to control which controls appear for a validator when they go to controltovalidate dropdown in property grid.  Is the solution to create a designer for the control?  How do you regulate that?  I can't override the ControlToValidate property... Thanks.Brian"Trust in the Lord and do what is good; dwell in the land and live securely. Take delight in the Lord, and He will give you your heart's desires" (Psalm 37: 3-4). Well ur logic is true, thats the way, what u need to do is not override the property (cant), create another property, that implemen...

What control do I use (or do I not use a control at all...)
Okay so here's the story so far. I am making a blog to be incorporated into a website. Well, I'm doing the blog from scratch. I'm using MySQL to source all the data via MySQL .NET/Connector. Now while developing the script, I used DataReader and Response.Write to show the blog topics. Now that it has come to put it under a design (I'm using a Master Page for that), I've hit the problem. Response.Write shows all the topics before any of the design elements could be incorporated. So that (more or less) is out of question. So next I looked into the data presentation controls. I looked up GridVi...

Using Validation Control When the control to validate is initially hidden
Hi to all, When I used the validation controls (RequiredField Validator)  in initially VISIBLE controls, it works fine. But when the controls i want to validate is initially hidden, it seems that the validation doesn't not work. What do you think is the problem?  By the way, my hidden controls is in a table inside a PopUpPanel which is inside an UpdatePanel. Hope you can help me. Thanks Khrizz   khrizz Hello!! You can use like following: to avoid this condition. protected void button1_Click(object sender, EventArgs e) { &nbs...

Cascading Dropdown error in formview controls and finding all controls in formview controls
can help with the following? Instantiate Cascading Dropdowns within Formview controls (this returns the error message "databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control".) Pass values between controls within master controls such as Textboxes within formviews (example: Pass the selected value in a dropdownlist to another textbox both WITHIN a formview control) Expose the public properties of a master page Hi arraybiz, 1) I need your code. See sample: http://www.mikepope.com/blog/fun/cascadingdropdowns_dy...

how to use the validation controls in dyanamic controls
  Hi All Frinds  1- I need Use The Validation Controls in Dyanamic Controls 2- How to supports arabic language in  Dyanamic Data Controls. Ineed ReName The Caption of Columns to  Arabic Language. thanks http://www.codeproject.com/cs/miscctrl/Control_Validation.aspGirijeshhttp://www.girijesh.in/...

Creating a User Control validator that validates a control on the page, rather than inside the control.
I'm trying to create a custom user control that is nothing more than a RangeValidator that validates other controls that lie on the page rather than inside the control itself... is this possible, is there a way to "bubble" it up. Thanks, G My answer to your other question regarding the CompareValidator applies here. If the custom control is in the same naming container AND does not implement INamingContainer, you can create a property that lets the user assign the control to validate. Internally assign the Validator.ControlToValidate property to the value of that property.-...

Custom Control within a Control Control
I am developing a custom controls that will render headers for different web sites. Within these controls, I want to place another custom control that will change the language. I created the language control and had it implement IPostBackDataHandler. This control works fine if I drag it on a new web form, but if I tell a header custom control to render it problems occur. The Language Selector custom control does not have a Page member anymore and the event handlers do not work. Does anyone have any experience with doing something similiar? Anyone have any suggestions? Thanks, ...

How do I control one control from another control?
I have a page page1.aspx which is within a master page. On page I have a table with two cells. Within each cell I have placed two controls (ascx) that I have developed. Now I'd like to be able to get these two controls to interact. One needs to update the other. One has some search criteria that the other one needs to update its gridview. One needs to make the other visible/not visible at certain times. Out of the box neither control can see each other at all. Is there a good article or someplace I can find some information on how to do this?  AllAboutFocus.com. Information Technolo...

Page and Control Flashing Using AJAX Control Toolkit Controls
Page and Control Flashing Using AJAX Control Toolkit Controls I'm using IE7 and the ASP.NET AJAX Control Toolkit.  I'm using two controls -- Accordion and CollapsiblePanelExtender.  I'm actually using 2 CollapsiblePanelExtenders, and the Accordion control is inside one of the panels for the CollapsiblePanelExtender (see the code below). The problem I'm seeing is that when I click an Accordion pane to open/close it or click the CollapsiblePanelExtender panel to open/close the panels, the controls and page flash while the animation is in progess.  Everything el...

User Controls not working if I put Validation controls in user control
Hi           I have validation controls(RequiredField Validator,RegularExpressionValidator)  in user controls.User controls are not posting back like the events are not wiring up.If I remove Validation controls in User controls page,user controls are working fine.Can anyone please help me out in getting it fixed. In the Validation controls, make sure you are setting the ControlToValidate property to the control that it links to.  If you're in .NET 2.0, it's also a good idea to put all the validation controls in the same Valid...

Trying to use the FAQ " Sorting and paging in the GridView control when not using data source controls "Sorting and paging in the GridView control when not using..."
and I am not getting the results I had hoped for.  I keep getting a "Compiler Error Message: CS0123: No overload for 'AdhocJobGridView_PageIndexChanged' matches delegate 'System.EventHandler'".   Here is my event handling... protected void AdhocJobGridView_PageIndexChanged(object sender, GridViewPageEventArgs e){ try { AdhocJobGridView.DataSource = wsBaseInfoArray; AdhocJobGridView.PageIndex = e.NewPageIndex; AdhocJobGridView.DataBind(); }catch (Exception ex) {throw ex; }   Here is my aspx... <asp:GridView ID="AdhocJobGridView...

ajax.net controls used in custom composite controls?
I am creating an events calendar that uses the accordion to display the events for the selected day.  The problem I'm having is that the accordion is not responding to any client side events.  I would really like to find a good "How to" article for building composite controls that incorporate an ajax.net control like the accordion....

Use 1 control validator to multiple textbox control
How can i set my validation control to be used by multiple textboxes. The logic is something like this. <asp:TextBox ID="TextBox1" runat="server" /> <asp:TextBox ID="TextBox2" runat="server" /> <asp:TextBox ID="TextBox3" runat="server" /> <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Field Required" ValidationGroup="Group1" ControlToValidate="TextBox1,TextBox2,TextBox3" SetFocusOnError="true"></asp:RequiredFieldValidator> I know i can only put 1 value to the ControlToValidate property of "RequiredFieldVal...

Web resources about - how to use validation controls on FormView control? - asp.net.presentation-controls

Cross-validation (statistics) - Wikipedia, the free encyclopedia
is a model validation technique for assessing how the results of a statistical analysis will generalize to an independent data set. It is mainly ...

Serena Williams eyes history, Caroline Wozniacki craves validation in women's US Open final
As Serena Williams eyes another slice of tennis history, Caroline Wozniacki is craving validation with a watershed US Open final triumph on Sunday ...

Travers Duncan asks High Court to strike down ICAC validation laws
ICAC could be sent back to the High Court as a challenge to new laws validating corruption findings looms.

Adam Scott proclaims Texas win as validation of No.1 ranking
... No.1 golfer, beating American Jason Dufner in the third hole of a play-off at the Colonial event. "It's a good feeling and maybe some validation ...

Hollande to sign gay marriage bill after Constitutional Council's validation
Hollande to sign gay marriage bill after Constitutional Council's validation People's Daily Online ... 26, 27, 28, 29, 30, 31. Jan, Feb, Mar, ...

Marketers, Get Ready for the 'Validation Era'
The public brands included has been engaging in a "friends" arms race. But there are signs that we know we overdid it.

Validation and Uncertainty
What an extraordinary conversation I had recently on Twitter. It started with Neil Killick’s statement that we should not consider our stories ...

Nvidia Icera 410 LTE Modem Passes AT&T Network Validation
... Today's news is a small step and logical precursor toward both goals, Nvidia's Icera 410 LTE and HSPA+ baseband has passed AT&T's network validation ...

Ting’s Q1 Subscriber Growth Suffers from Sprint’s New Unlocking Validation Process
Back in February, Sprint updated the process it uses to validate unlocked devices that customers want to utilize on other carriers or one of ...

[Android M Feature Spotlight] Stricter APK Validation Now Actually Checks If All Of An APK's Files Are ...
While you might file this one under "really? We weren't doing this already?" if you're a security expert, Google has added stricter validation ...

Resources last updated: 11/28/2015 12:20:54 AM