M
Mike
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 "PlaceHolder" controls, as follows:
<SIGMA:NAMINGPLACEHOLDER id="Activities" runat="server"></SIGMA:NAMINGPLACEHOLDER></td>
<SIGMA:NAMINGPLACEHOLDER id="Body" runat="server"></SIGMA:NAMINGPLACEHOLDER></td>
<SIGMA:NAMINGPLACEHOLDER id="QuickView" runat="server"></SIGMA:NAMINGPLACEHOLDER></td>
Then, in a webForm, I use the custom control "Template", as follows:
<uctemplate:template id="ucTemplate" runat="server"></uctemplate:template>
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 "PlaceHolder" class (hyp.Click += new System.EventHandler(this.ActivityClicked), in the "Template" control too, but nothing happens. What am I doing wrong here? Is it the proper way of doing this?
Thanks
Mike
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 "PlaceHolder" controls, as follows:
<SIGMA:NAMINGPLACEHOLDER id="Activities" runat="server"></SIGMA:NAMINGPLACEHOLDER></td>
<SIGMA:NAMINGPLACEHOLDER id="Body" runat="server"></SIGMA:NAMINGPLACEHOLDER></td>
<SIGMA:NAMINGPLACEHOLDER id="QuickView" runat="server"></SIGMA:NAMINGPLACEHOLDER></td>
Then, in a webForm, I use the custom control "Template", as follows:
<uctemplate:template id="ucTemplate" runat="server"></uctemplate:template>
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 "PlaceHolder" class (hyp.Click += new System.EventHandler(this.ActivityClicked), in the "Template" control too, but nothing happens. What am I doing wrong here? Is it the proper way of doing this?
Thanks
Mike