Home > Asp.net > Adding UserControl Dynamically and Set Properties in Asp.net

Adding UserControl Dynamically and Set Properties in Asp.net


Adding UserControl Dynamically and Set Properties in Asp.net

ucMyUserControl ucUser = (ucMyUserControl )LoadControl(“~/folder/MyUserControl.ascx”);
ucUser.MyProperty = “I got my property”; 
MyDiv.Controls.Add(ucUser);

For More Details Visit : http://www.highonmicrosoft.com/dynamically-loading-and-accessing-the-properties-of-the-user-control.html http://stackoverflow.com/questions/213429/programmatically-adding-user-controls-inside-an-updatepanel http://geekswithblogs.net/samerpaul/archive/2009/11/13/dynamically-adding-web-user-controls-and-accessing-their-properties-by.aspx http://stackoverflow.com/questions/508826/set-properties-on-dynamically-added-usercontrol

About these ads
  1. May 2, 2013 at 7:52 pm | #1

    Hello, There’s no doubt that your web site may be having internet browser compatibility problems. Whenever I look at your site in Safari, it looks fine however, when opening in IE, it’s got some overlapping issues.

    I just wanted to give you a quick heads up! Aside from that, great website!

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: