Referencing a text box in a user control placed within another user control

 I need help in referencing a text box from .aspx code behind. This text box is placed in a user control uc1 that is placed within another user control uc2. User control uc2 is placed on the page.

 

Thanks!

0
phiphy
9/4/2008 11:20:09 AM
asp.net.web-forms 93655 articles. 6 followers. Follow

3 Replies
983 Views

Similar Articles

[PageSpeed] 0

 UserControl foundControl = ((UserControl)uc2.FindControl("uc1"));

Textbox foundTextbox = ((TextBox)foundControl.FindControl("TextBox1"));

or something like that Stick out tongue


Don't forget to click "Mark as Answer" on the post that helped you.
0
tompy_nation
9/4/2008 12:11:47 PM
Can that be done in a single statement?
0
phiphy
9/4/2008 12:49:14 PM

((TextBox)((UserControl)uc2.FindControl("uc1")).FindControl("TextBox1"));


Don't forget to click "Mark as Answer" on the post that helped you.
0
tompy_nation
9/4/2008 1:19:58 PM
Reply:

Similar Artilces:

UpdatePanel within a web user control resets data of controls outside the user control
Hello, I have a usercontrol on my page which displays a running marquee text. It makes use of an UpdatePanel (within the user control) to refresh the marquee text (within the updatepanel) at periodic intervals. For this I added a timer control and its tick event as an async postback trigger for the UpdatePanel. I have a lot of textboxes and dropdown list boxes (all with runat=server) on the page outside the above user control. These are also contained in different UpdatePanels. Problem is, when the user control does a postback to refresh the marquee text, it causes some of...

User Control Within UserControl
If I have a user control A and then inside it a user control B embedded/referenced within it.  User Control A has a panel defined (cpeNewUser) that I want to manipulate from the code behind of User Control B based on some event that happens.So putting this in my code behind of User Control B won't work as it has no idea of cpeNewUser:cpeNewUser.Collapsed = true;So is it because only at runtime they are married up and because of this you cannot access each other's objects at compile time?  How would I get this to work becuase I'm using all user controls inside a AJAX Too...

How to load user control within another user control?
I have many user controls. One of them is Banner.ascx which I may load it within anothers. I tried to load Banner.ascx within Footer.ascx but  I got an error "The control collection cannot be modified during DataBind, Init, Load, PreRender or Unload phases."Any ideas?Any answer is appreciated highly.Thanks. Hi friend, Check the following paragraph, perhaps it can help you,   Does your application run on .NET Framework 2.0 or above? If so, from the error message, the cause of the error is that you are trying to access a property on a child control in OnInit phase, wh...

Web User Control to Web User Control...
Hi, I have 2 User controls on a page and want Control1 to call a method of Control2. Is this Possible? Example: Con1 = Datalist showing products, each with a Quantity Box and a Button. Con2 = Repeater showing Cart Preview (name, Price) in page.aspx. When I click on the button on the DataList in Con1 it adds the item into the Session based Cart. However it does not update the Cart Preview. I need to call BindPreview() in Con2 in order to update the Cart Preview... Does that make sense? argh! any help much appreciated! PeteWeb Design Nottingham, UK Well I can call BindPreview() from m...

Using user control within another user control
Hi, Can I register and instantiate a user control within another user control. Yes, of course you can.  If you are doing it dynamically, then you have to remember that you have to do it in every postback there after. <%@ Register Src="usercontrol1.ascx" TagName="TagName" TagPrefix="uc1" %> <uc1:TagName ID="UserControlID1" runat="server" /> ...

Calling user control within another user control
I want to call one user control within another user control, but I get all sorts of errors when I try to do this. Is this possible ? if so how to go about it. {code} <%@ Control Language="C#" AutoEventWireup="true" CodeFile="i_top.ascx.cs" Inherits="i_top" %> <%@ Register TagPrefix="agg" TagName="siteowner" Src="~/templates/i_siteowner.ascx"%> <div id="navbar"> <h2 class="hide">Site wide navigation</h2> <ul> <li><a href='~/default.aspx' id...

reference user control within another user control
1) user control named EditBar (used for appending editing feature buttons specific to page mode - add, search, delete) <Script Control Language="vb" runat="server" > Public Sub EditBar_CustomersAdd() ctl_EditBar.Text &= "<img src=""/tims/images/add.gif"" width=""24"" height=""24"" border=""0"" alt=""Add a Customer"">" End Sub .... other methods omitted for simplicity </Script> <asp:Label id="ctl...

Web user control inside update panel replace with another web user control
 Hi there. I have a page with a menu. an and then the content. My thing is. That i have the update panel, and inside that i have a regual panel in which i add the Web User Controls i need. Which all works fine. My problem is. That i i have a submit funcion on almoast all the Web User controls. What i would like is that i inside that update panel, can dispose the original Web user Control and then add a response Web User Control. In normal language. Is there a way that i can load one web user control into antoher and then disposose the original? Thanks in advance hello. well, what ...

access controls on web user control x from web user control Y
I have 2 web users controls in a page and I would like to get or set the selected values of a few dropdown boxes on web user control X from web user control Y and I also would like to know how to access functions that are on a web user control X from a web user control Y, is this possible? How can I do it? User can access and set the values of the User Control from .aspx page through properties,using javascript and in code-behind of aspx page.The details of it are shown below Using PropertiesIf the Sample.ascx control has two textboxes and submit button.You can access the valu...

How to access a user control from another user control in a Wizard control
My page has a wizard control and each step is a user control.  I could find the value of a control in step1 user control in the wizard page but not in step2 user control.From wizard.aspx.vb – it worksDim m_title As DropDownList = CType(Me.PersonalBox1.FindControl("ddlTitle1"), DropDownList) Question:How can I find the value of a control(textbox or dropdownlist)in step1 user control from step2 user control? I want to find “PersonalBox1.FindControl("ddlTitle1")” from Step2 AddressBox1. I have tried several ways to access it but no luck. From AddressBox.ascx.vb –...

Referencing User Control In Some Other User Control
hi, I have two user controls namely CanvasGrid.ascx and GridUtility.ascx. CanvasGrid.ascx is just a container for displaying GridView control in a placedholder GridPH. I want to get the checked rows from GridView control of CanvasGrid.ascx and do tagging against specific name selected from the TagDropDownList of GridUtility.ascx. But the problem is that I am not geting the reference of GridView as it is coming null everytime even when I am using FindControl() to find the GridView control on the page. GridUtility.ascx is a part of CanvasGrid.ascx and it is placed in a placehol...

I have a web user control being used by another web user control, but the one being used will not display the labels in the resx file.
I am using DotNetNuke version 3.13 (might be 3.013) on a Window's XP machine, SP2. I have what I find to be an extremely odd situation. I have a project called TDS.Controls. This project is a web control library. Each control has its own resx file, which is located in the App_LocalResources directory. Each control inherits from Framework.UserControlBase, just like DotNetNuke's User control in DNN\Controls\User.ascx.vb. As a matter of fact, this control is doing the exact same thing I am trying to do. It is a web user control with its own resx file being used by another web user control (See ...

(How) Can i use the form elements of a user control from another user control???
Hi, i have a user control with 4 other user controls. Actually i have 4 panels and each user control is inside a panel. Its like a 4 page form which are all connected to each other. Is it possible to have access to web controls that i have in my user controls from the main user control. In my main user control i have a submit button and a tab list. User can browse through the tabs and each tab is bound to a panel. so clicking on tab1 makes panel1 visible which holds the first user control, second tab makes second panel visible and the rest invisible and the second panel holds the ...

Unable to access user control's user control's function\property from another user control
Hi, I used to call an user control's user control function as stated below from my user control in ASP.Net 1.1 wucCompany.wucEmployee.GetEmployeeSomething() After migrating to ASP.Net 2.0, I am unable to use any properties/functions(even the public ones) of the user control's User control's from another user control.  The way I have to do is create property\function in wucCompany which calls the wucEmployee's property\function and call the wucDepartment.GetEmployeeSomething().Since I need to do this change in too many places, I can...

Web resources about - Referencing a text box in a user control placed within another user control - asp.net.web-forms

Wikipedia:Referencing for beginners - Wikipedia, the free encyclopedia
References (refs) on Wikipedia are important to validate writing and inform the reader. Any editor can potentially remove unsupported material, ...

Facebook Testing Posts From Pages Users Haven’t Liked Referencing Pages Users Have Liked
Some Facebook users are seeing organic posts in their news feeds that suggest posts from pages they have not liked when the posts are in reference ...

McDonald's Ad Referencing 9/11, Boston Bombing Provokes Strong Reactions
NEW YORK — An ad by McDonald's is testing the fine line companies need to walk when referencing national tragedies. The ad by the world's biggest ...

iCloud storage warning emails already referencing iOS 8 & iCloud Drive
Those annoying iCloud storage warning email notifications have begun referencing the upcoming iOS 8 and iCloud Drive, according to multiple tips ...

Begich, Sullivan campaigns pull controversial ads referencing Mountain View case - Alaska Dispatch
... representing the victims' family in a high-profile murder and sexual assault case in Anchorage, the Sullivan and Begich camps pulled ads referencing ...

Protesters briefly disrupt Google I/O, referencing evictions, “robots that kill”
Meanwhile, a more quixotic protest results in 10 arrests in Mountain View.

Emma Sulkowicz Created Rape-Referencing Video - artnet News
Watch the video that Emma Sulkowicz allegedly created, which alludes to rape, and seems to build on her controversial mattress performance.

A quick guide to referencing
Back in March as part of a series on Blog Ethics I wrote about Attribution where due , but in light of all the recent noise about spam blogs, ...

Man Arrested for Throwing Books While Referencing Scripture in Lakewood Church Store
A man was taken into custody for tossing books and knocking displays down all while referencing a particular scripture in Lakewood Church's book ...

“Tesla Crash” Website — Connecticut Auto Dealers Association Makes Anti-Tesla Website Referencing Content ...
... it simply can’t be helped. Case in point: the Connecticut Auto Dealers Association recently put together a new anti-Tesla website referencing ...

Resources last updated: 12/21/2015 9:08:38 PM