473,399 Members | 2,278 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Reference a control on page from a custom control?

Good Morning,
I have a user control I dynamically load in the page_init event into a
asp:placeholder control. This page also has another placeholder I would
like to dynamically load controls into when the user takes an action on my
first dynamically loaded control.

Control 1 is a couple of asp:button controls. I am able to tap into their
events, but in the code behind, I want the click event of one of the buttons
to load another user control into the 2nd placeholder control on the page.
Does this make sense. I am sure it's some kind of "parent" or "page"
reference to reference placeholder #2. Also with I need to remove a
previosly loaded control from the placeholder when I wish to change the
control in it?

Any and all suggestions are welcome.

Kind Regards,
Chris
Nov 19 '05 #1
2 1554
Chris,
Yours is a ver common situation. What you need to do is raise an event
on button click in Control 1, which you should handle on the parent
page. From here you can hide control 1 and load Control 2 (placeholder #2).
Uttara

Chris Kettenbach wrote:
Good Morning,
I have a user control I dynamically load in the page_init event into a
asp:placeholder control. This page also has another placeholder I would
like to dynamically load controls into when the user takes an action on my
first dynamically loaded control.

Control 1 is a couple of asp:button controls. I am able to tap into their
events, but in the code behind, I want the click event of one of the buttons
to load another user control into the 2nd placeholder control on the page.
Does this make sense. I am sure it's some kind of "parent" or "page"
reference to reference placeholder #2. Also with I need to remove a
previosly loaded control from the placeholder when I wish to change the
control in it?

Any and all suggestions are welcome.

Kind Regards,
Chris

Nov 19 '05 #2
OK how do I do that? I can not figure out to get the page to react.

"uttara" <pl*******@hotmail.com> wrote in message
news:Od**************@tk2msftngp13.phx.gbl...
Chris,
Yours is a ver common situation. What you need to do is raise an event on
button click in Control 1, which you should handle on the parent page.
From here you can hide control 1 and load Control 2 (placeholder #2).
Uttara

Chris Kettenbach wrote:
Good Morning,
I have a user control I dynamically load in the page_init event into a
asp:placeholder control. This page also has another placeholder I would
like to dynamically load controls into when the user takes an action on
my first dynamically loaded control.

Control 1 is a couple of asp:button controls. I am able to tap into
their events, but in the code behind, I want the click event of one of
the buttons to load another user control into the 2nd placeholder control
on the page. Does this make sense. I am sure it's some kind of "parent"
or "page" reference to reference placeholder #2. Also with I need to
remove a previosly loaded control from the placeholder when I wish to
change the control in it?

Any and all suggestions are welcome.

Kind Regards,
Chris

Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Henri | last post by:
Hi I would like to use a User Control to render the body of the mail I send. The problem is that my application is not an ASP.NET page so I can't use any Page reference to call LoadControl What...
6
by: blash | last post by:
Can someone help me? I really don't have a clue. My company staff told me they often got such error: "Object reference not set to an instance of an object." when they are in search result page...
7
by: Shimon Sim | last post by:
I have a custom composite control I have following property
2
by: Suzanne | last post by:
Hi all, I'm reposting this message as I'm experiencing this problem more and more frequently : I really hope someone out there can help me as I've been tearing my hair out on this one for a...
2
by: Alan Silver | last post by:
Hello, I have a custom control that is inside a DLL. Until now, I have had the source file for this DLL in a development folder on my machine, and I've been compiling it using csc on the command...
1
by: Don | last post by:
I'm getting the following exception displayed in the task list at design time for my project: "Code generation for property 'Controls' failed. Error was: 'Object reference not set to an...
0
by: philaphan80 | last post by:
Is there a way to force the Visual Studio IDE (Page Control at design- time) to refresh / repaint itself upon drag & drop of *any* item from the toolbox? Perhaps a method I need to override within...
4
by: =?Utf-8?B?UmljaEI=?= | last post by:
I am trying to create a project using the ASP.NET AJAX accordion control. I would like to dynamically add panes to the control with a form template added when the pane is added. I have tried...
3
by: chandhrakv | last post by:
Event code: 3005 Event message: An unhandled exception has occurred. Event time: 11/18/2009 3:03:53 PM Event time (UTC): 11/18/2009 9:33:53 AM Event ID: ef3014ea80424b00b1bc2e7095fffe4c ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.