473,734 Members | 2,798 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1565
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*******@hotm ail.com> wrote in message
news:Od******** ******@tk2msftn gp13.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
1594
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 should I do ? Thanks Henri
6
6126
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 then tried to access 2nd, or 3rd, etc page. The problem is it happens sometimes - sometimes when they clicked refresh button, then everything is ok. Now they told me it happens more frequently. but I have tried by myself many times and never got...
7
3012
by: Shimon Sim | last post by:
I have a custom composite control I have following property
2
2592
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 good while and I'm getting really frustrated now! My problem is this - my custom controls periodically disappear from my
2
3275
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 line. I reference the control in the DLL on a master page by adding the line to the top of the file... <%@ Register TagPrefix="Fred" Namespace="FredECommerceControls" Assembly="ECommControls" %>
1
8366
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 instance of an object.'" I've traced the problem to a custom control I created that inherits from Inherits System.Windows.Forms.TextBox. In this custom control, I have two constructors. I'm not sure why I created the second constructor -- it was so...
0
2276
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 the page control? I'm aware of using "ComponentModel.RefreshProperties(RefreshProperties.All)" within custom controls, but that only refreshes the page when something specific to that custom control is changed. I'm looking for a way to hook...
4
2486
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 unsuccessfully in creating the whole pane as a user control and have succeeded in adding the pane and then dynamically adding the content which is a user control to the pane, dynamically within the page. However I would like to have a single pane...
3
4562
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 Event sequence: 34707 Event occurrence: 17 Event detail code: 0 Process information:
0
8946
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8776
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9182
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8186
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6735
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6031
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3261
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2724
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.