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 11

Expert Comment

ID: 11839794
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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
In an interesting question ( here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

752 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