471,348 Members | 1,756 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,348 software developers and data experts.

add parameter into dynamic user control

Dear all,

how can I pass a parameter to dynamic user control?
As I know we can pass parameter into traditional user control.
e.g: add pageid into user control and write a property from user control
<uc1:uccc id="uccc1" runat="server" pageid="1"></uc1:uccc>

I can create dynamic user control but don't know how to pass parameter into
user control.

****************** my original code ***********************
Control myControl = (Control) LoadControl("control/template1.ascx");
PlaceHolderTemplate.Controls.Clear();
PlaceHolderTemplate.Controls.Add( myControl );
************************************************** ********

Thanks in advanced.
steambun


Dec 1 '05 #1
1 1647
KJ
Hello. Declare uccc1 in your .cs code file as a protected template1
object (e.g., protected template1 ucc1). You don't need to use
LoadControl.

Then, you can reference ucc1 anwhere you like in the .cs file, set its
properties, call its methods, whatever.

Dec 1 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Stanley Cheung | last post: by
9 posts views Thread by Tarscher | last post: by
reply views Thread by Eniac | last post: by
reply views Thread by Ronak mishra | last post: by

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.