Hi,
I have a class library (dll) in which I defined a class for a custom control (called PlaceHolder). In a separate Web project, I created a custom control (called Template.ascx) that contains three "PlaceHolde r" controls, as follows:
<SIGMA:NAMINGPL ACEHOLDER id="Activities " runat="server"> </SIGMA:NAMINGPLA CEHOLDER></td>
<SIGMA:NAMINGPL ACEHOLDER id="Body" runat="server"> </SIGMA:NAMINGPLA CEHOLDER></td>
<SIGMA:NAMINGPL ACEHOLDER id="QuickView" runat="server"> </SIGMA:NAMINGPLA CEHOLDER></td>
Then, in a webForm, I use the custom control "Template", as follows:
<uctemplate:tem plate id="ucTemplate " runat="server"> </uctemplate:temp late>
The control "Activities " is a dynamic list (built from a DB), and it populated as follows:
oWriter.Write(" <a href=''>" + hyp.Text + "</a>" + "<br>");
What I would like to do now is add a "click" event to the aforementioned dynamically created control (oWriter.Write( ".......")) . This would allow me to load in the "Body" of the webForm the related custom control (called "MySample1.ascx ", or "MySample.ascx" , or "MySample3.ascx ", etc.) depending on the dynamic control (list of "Activities ) that was clicked.
I tried adding the event in "PlaceHolde r" class (hyp.Click += new System.EventHan dler(this.Activ ityClicked);), in the "Template" control too, but nothing happens. What am I doing wrong here? Is it the proper way of doing this?
Thanks
Mike 0 1356 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: wASP |
last post by:
Hello again to all of you geniuses,
I'm having a problem trying to load dynamic controls at the initialization phase.
I've read the docs, and I thought I had it figured out:
<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>
<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>
.NET Framework Class Library
Control.Init Event
|
by: hybrid |
last post by:
I have problems in understanding the behavior of the events triggered by
dynamically created controls over a webform.
Could you help me?
In a webform, I have a static PlaceHolder PH containing a table of
controls, dynamically generated. Among these, a linkbutton (LinkBtn) to
which have attached a click handler method, LinkBtn_Click(...) .
Generally it works fine, but if in the LinkBtn_Click(...) code I try to
access a webform control,...
|
by: Andy |
last post by:
Alright, I am beyond confused here and need some guidance. I need a
C# only sample. I have a simple Page and within it i am creating a
user control (ascx). The user control contains textboxes, buttons,
ect. I would like to catch/add a handler/recieve the Button.OnClick
event from the buttons that are in the user control, in the Page.
How? As far as I can tell, my only route is to:
RaiseBubbleEvent in the Button.OnClick in the...
|
by: Shourie |
last post by:
I've noticed that none of the child controls events are firing for the first time from the dynamic user control. Here is the event cycle.
1) MainPage_load
2) User control1_Load
user clicks a dropdown in UC1
_________________________
1) MainPage_Load
2) User Control_1 Load
|
by: Assaf |
last post by:
Hi all.
In response to user selections, our app adds controls (buttons, image
buttons) dynamically to a page with Controls.Add(myNewButtonControl).
Now that we gotten on the page we want to make them do something for a
living: how do we dynamically create events that the controls respond to?
TEA for any pointers.
| |
by: mytestemailaccount |
last post by:
Hi,
Hope you can help.
I am relatively new to all this but would appreciate the groups help.
The scenario:
I am c# and asp.net to create a web application. The web page contains
a user control (.ascx).
|
by: scsharma |
last post by:
Hi,
I am working on creating a webapplication and my design calls for creating
main webform which will have menu bar on left hand side and a IFrame which
will contain all the forms that are shown when menu items are clicked.Besides
these i would like to put a custom status bar. Any error message encountered
in any of the webpage will be displayed in the banner.
The problem iam encountering is how to access the customer status bar in
child...
|
by: Steve Moreno |
last post by:
Hi all,
I've got a web form that I've written code to create an array of
DropDownList controls on the page depending on how many records are pulled
back. The code to create the controls is working fine but now I need to add
events to the newly created DropDownList controls. I need to add the
SelectedIndexChanged event and I'm having a hard time getting the code to add
events to the controls since the names (IDs) are varied to include...
|
by: Steve Hershoff |
last post by:
Hi everyone,
I've got a strange one here. There are two datagrids on my page, one nested
within the other. I'll refer to them as the topmost and secondary
datagrids.
In the topmost datagrid's OnItemDataBound() method we check for the row in
which it's appropriate to add the secondary datagrid. Exactly one row in
the topmost grid will contain the secondary grid.
|
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...
|
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,...
| |
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...
|
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...
|
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |