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
10/14/2008 4:06:32 PM 72751 articles. 3 followers. Follow

5 Replies

Similar Articles

[PageSpeed] 30

Hi arraybiz,

1) I need your code. See sample:

2) Handle SelectedIndexChanged event of DropDownList:

protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
        DropDownList ddl = (DropDownList)sender;
        string ddl_value = ddl.SelectedValue;
        TextBox tb = (TextBox)FormView1.FindControl("TextBox1");
        tb.Text = ddl_value;

3) Try something like this: LinkButton lb = Master.Page.FindControl("LinkButton1") as LinkButton;


Qin Dian Tang
Microsoft Online Community Support

Please remember to mark the replies as answers if they help and unmark them if they provide no help.
10/17/2008 2:57:06 AM

Hi Qin thanks for your reply; will try your suggestions and send code 


10/17/2008 12:14:27 PM

  • Expose the public properties of a master page

Inherits System.Web.UI.Page


MasterPage.(your object here)

works for me. As simple as that :)

10/17/2008 1:17:50 PM

Hi Jane

On my aspx page named test I want the value in a label called label8 from the value in a label on my master page called label6

I tried your statement on my page but got "declaration expected" (blue jaggedline under the word MasterPage)

Partial Class testInherits System.Web.UI.Page


label8 = masterpage.findcontrol("label6")


10/20/2008 5:13:30 AM

Hi Qin

I have accomplished using the findcontrol method sucessfully thanks to your guidance.

 my multiple dropdown code example will follow later today


10/20/2008 6:02:28 AM

Similar Artilces:

How do I control parameter a control that is inside a formview that has another formview in it?
I have a formview2 within another formview1 but I want to control parameter from a sqlDataSource3 outside the formview a control that is in formview2<asp:SqlDataSource ID="SqlDataSource1" SelectCommand='SELECT "USER,UID" FROM "TUSERS"'><asp:FormView ID="FormView1" runat="server" DataSourceID="SqlDataSource1">    <ItemTemplate>        <asp:Label ID="Label1" runat="server" Text='<%# Bind("USER") %>'></asp:La...

How access controls in formview control?
I have a Lable control inside of a Formview control Empty Template. How do I access the lable control in the empty tamplate in the databound method? Try:if (FormView1.Row.RowType == DataControlRowType.EmptyDataRow) { Label l = (Label)FormView1.FindControl("Label1"); if (l = !null) { l.Text = "Found a label"; } }  Regards,Vinz"Code, Beer and Music" that's my way of being a programmer!How to get your Forum Question Answered | Blog | CodeASP.NET vinz:Try:if (FormView1.Row.RowType == DataControlRowTy...

Formview control with in Wizard control
I have a wizard control in which it promts the user if he is a delaer or customer. on next step it displays the result. Results are almost same for both dealer and customer but for customer I need to remove few things. How can I take care of this? one thing I can do is create unique steps for dealer and customer. There shoud be a work around just to hide few items. With in formcontrol I am using table? How can I have different color for each row and column within form to make is easy for user to read? Is there some template property I need to use for form? you can use wizard step events...

problem of find control in nested Formview control
I can find my Textbox contols in following structures, <asp:Panel ID="Popup1" runat="server" CssClass="popup" style="display:none;" >      <asp:UpdateProgress id="UpdateMessagesProgress" DynamicLayout="false" runat="server" DisplayAfter="0">         <ProgressTemplate>             Processing...        </ProgressTemplate>    &n...

SqlDataSource with FormView: Referencing a control inside FormView as control parameter?
I have been looking at this website and was wondering...what if my FormView control had a textbox or label inside of it in its EditTemplate item...can I link my SqlDataSource object (which is also bound to the FormView control) to that control meaning specify control parameter as the textbox which is inside the FormView...? PS: I use vbexpress 2005 programming blog Hi:   You can try something like: <asp:ControlParameter ControlID="FromView1$DropDownList1"   But please make sure the DropDownList (or any other controls) be available all the time. In anoth...

Referencing Nested FormView Control inside the EmptyDataTemplate of a FormView Control
Hi all,I am very new to ASP.Net and have been working on a particularly frustrating problem now for days and cant seem to find an answer to it. I am building a front end to a newly created database and have set 2 session variables that I am using to set default values using the FindControl Method. this works fine until I need to set default values in a nested control. IE...I have a form view control and in that controls EmptyDataTemplate I have another form view control with about 10 fields using the same datasource as the parent form view. I need to place default values in 2 of those fields...

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? Information Technolo...

FormView Control
Hi Guys,I am trying to get my head around the new data presentation controls, specifically the FormView.I have a situation whereby, when in "insert" mode, if there is an exception (e.g. duplicate key), the exception is handled in the "Inserted" event of the ObjectDataSource, a suitable message is displayed for the user via a label control, and the e.ExceptionHandled property is set to "true".The user's error message is displayed fine, but all of the values for the controls within the FormView (e.g. text boxes) are empty, forcing the user to re-enter all of t...

Cannot find control in control parameter error
 Hi, Please, some help here as to why i'm receiving the following error;Could not find control 'txtUser' in ControlParameter 'USERNAME'. My code; <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Logon.aspx.vb" Inherits="Default3" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ""> <html xmlns="" > <head runat="server"> <title>Unti...

how do i get a control which is in formview control from javascript?
 Hi All.I have the following javascriptfunction validateUploadFiles()    {        var fileUpload = document.getElementById('fileUpload')        if (fileUpload.value.length == 0)        {            clientside_arguments.IsValid=false;            return;        }        var regExp = /^(...

controls not visible inside formview control
I am trying to write a query to select data from one table based on the resultof a drop down list that pulls data from another table. The query I am writing is: "SELECT church.churchName, church.churchId AS Expr1 FROM [churches]WHERE ([deanery.deaneryId] = @churches.deaneryId)"I am using a sql source controlNow I found an example from a website that pulls data from one drop down list and usesthe selected value to populate the second drop down list. But, the controls are not part of a formviewcontrol. So my question is how do I get the dropdownlist control that is located...

Programming ajax control in formview control
I got formview1 control. In itemtemplate i have textbox1, label1 and SliderExtender1 controls. SliderExtender1 targetcontrolid is textbox1. As BoundControlID i want use label1 to display value from slider. In dropdown list in properties menu i don't see label1. I tried to use findcontrol method to find and set properties it as shown below: Dim lb1 As Label = CType(FormView1.FindControl("label1"), Label) Dim slex1 As SliderExtender = CType(FormView1.FindControl("SliderExtender1"), SliderExtender) slex1.BoundControlID = lb1.ID but it doesn't work. ...

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 'ControlT...

Web resources about - Cascading Dropdown error in formview controls and finding all controls in formview controls -

Cascading Style Sheets - Wikipedia, the free encyclopedia
Cascading Style Sheets ( CSS ) is a style sheet language used for describing the presentation semantics (the look and formatting) of a document ...

Ads API Profile: Alchemy’s Cascading Ad Creation, Analytics, and Auto-Optimization
Facebook’s performance advertising system provides buyers with a wealth of targeting options, but not the depth of control or analytics to effectively ...

Twitter blames global outage on 'cascading bug'
AFTER nearly a year without any significant periods of downtime, using Twitter was almost nothing like the early days of being on the service. ...

In defence of Gen Y, and cascading generations, by a boomer
Some accuse Generation Y of feeling entitled, overly precocious, demanding and rude but that doesn't necessarily reflect reality.

In defence of Gen Y, and cascading generations, by a boomer
Some accuse Generation Y of feeling entitled, overly precocious, demanding and rude but that doesn't necessarily reflect reality.

Cascading Style Sheets - 9to5Mac
Adobe announced updates on Thursday to many of its HTML5 design tools for Creative Cloud users. Among the updates, we get new features for Edge ...

West Texas Cascading Safety Failure
In the interests of Calamity Fairness, here’s a most depressing Bloomberg article : Texas Explosion Seen as Sign of Weak U.S. Oversight The ...

Watch this captivating video of 11,000 marbles cascading down a marble run
Everyone has a hobby. Some people like to play recreational sports, others prefer to go fishing, but did you know there are creative types out ...

Austria Announces Fence With Slovenia; Irony of German Whine; Cascading Fences; Mish Proposed Strategy ...
Two months ago, Austria's chancellor Werner Faymann criticized Hungary for building a fence along its border. Faymann proclaimed "To think that ...

Cascading Slopes is Jacob from The Drums' new band, NYC residency this month
Cascading Slopes at Cameo, 1/31/2013 (via @FreshBread) Cascading Slopes is a new project from Jacob Graham of The Drums. Unlike his other band, ...

Resources last updated: 12/4/2015 10:25:17 AM