dynamically loading custom control????

F

Farooq Khan

hi,
i have designed my own control having a public property. i want to be able
to set that property as the page, having that control in it, loads.
the inline code for the page is (assuming MyControl is the TagPrefix and
Control1 is the TagName and MyProperty being string type property):

<MyControl:Control1 id="someID" MyProperty="<%
Response.Write(Request.QueryString["SomeValue"].ToString()); %>
runat="server" >
</MyControl:Control1>

second how can i dynamically add different no. of such controls.

Thanks.

Best regards,
Farooq Khan
 
M

Michel

Hi Farooq,

You can use LoadControl method and pass it the name of the ascx (e.g.
LoadControl("myControl.ascx").

Hope this helps,
Michel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top