I have a WebUsercontrol (Num1.ascx) that contains a placeholder(MyPlaceholder)
This placeholder will contain a WebUser control(Num2.ascx) loading it up dinamically using C#.
The Num2.ascx contain 2 controls. One is a Label and the other one is a Drop Down List.
The information for this control are loaded from database(this part is done).
What I am trying to do:
I want to add dinamically an anchor <a> to Num2.ascx through the codebehind in Num1.ascx.
This is the anchor:
');"><img alt="Click for Information" title="Click for Information" src="images/common/Informa
What I have so far:
I created an object(object1) in Num1.ascx that will load the Num2.ascx dinamically :
Num2 object1= (Num2)Page.LoadControl(@"~
It is in this object "object1" where I need to add the element anchor<a>. Later on I will add this object to my placeholder in Num1.ascx, so it can be display in the page :
What "object1" need to have after this operation are the following controls::
- Drop Down List
- Anchor (new control add it in dinamycally with some properties)
Could you give me an example using my code how can I add the anchor dinamically to this object?
<asp:PlaceHolder ID="MyPlaceholder" runat="server"></asp:PlaceHolder>
<asp:Label ID="lblQuestion" runat="server" Text="Question?"></asp:Label>
<p><asp:DropDownList ID="ddlAnswers" runat="server"></asp:DropDownList></p>