Calling 1 user control from inside another user control

Posted on 2004-08-19
Last Modified: 2012-06-22
Hi Experts

I have a Header, Content and Footer split in my Main.aspx page; what I do is call a user control on my page load event:

ContentPane.Visible = True

Then I want to call a second user control from in side “UC1.ascx” and put it in my HeaderPane.
For example:
HeaderPane.Visible = True

How do I get this working?

Thanks for the help
Question by:deon001
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
LVL 35

Accepted Solution

YZlat earned 240 total points
ID: 11840270
Dim uc As UserControl
 uc = New UserControl()
uc = Page.FindControl("UC2.ascx")

Author Comment

ID: 11878291
Thanks for the help.

When I use: “HeaderPane.Controls.Add(uc)” I get an error:”HeaderPane is not declared”.

I used: Response.Redirect("Home.aspx?headerpane=LoborControls/uc.ascx")

LVL 35

Expert Comment

ID: 11891318
how do you declare your HeaderPane?

Author Comment

ID: 11891765
In my Webpage.aspx :

<form id="Main" name="HomePage" method="post" runat="server" class="Body">
<TABLE id="Table1" width="100%" height="100%" cellpadding="0" cellspacing="0" border="3"
            <TD id="HeaderPane" runat="server" height="60" bgcolor="#296342"></TD>
            <TD id="MenuPane" runat="server" height="20"></TD>
            <TD id="ContentPane" runat="server"></TD>
            <TD id="FooterPane" runat="server" height="20"></TD>

What I want to do is open a user control say UC2.ascx in the Webpage.aspx’s “HeaderPane” from inside my UC1.ascx.

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question