Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 29th, 2007, 12:49 AM
Registered User
 
Join Date: Jan 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default programmatically loading usercontrol

how to load the user control dynamically??


 
Old January 29th, 2007, 09:53 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

What type of application?

In web forms (in the context of an executing page), you'd do something like this:

MyUserControl objControl;
objControl = (MyUserControl)this.LoadControl("MyUserControl.asc x");

Then you can add the control to the page or to a placeholder, etc.:

plcAPlaceholder.Controls.Add(objControl);

-Peter
 
Old January 30th, 2007, 09:05 AM
Registered User
 
Join Date: Jan 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

well i want to load the control in C#.







Similar Threads
Thread Thread Starter Forum Replies Last Post
ArrayList with UserControl rhd110 General .NET 2 August 12th, 2007 12:29 PM
Binding from usercontrol sarah lee ASP.NET 2.0 Basics 1 June 12th, 2007 04:32 AM
Get value of a QueryStringParameter in UserControl hpox ASP.NET 2.0 Basics 1 February 16th, 2007 11:54 AM
UserControl in DataGrid kdkcchoco ASP.NET 1.0 and 1.1 Professional 7 January 23rd, 2007 04:38 PM
UserControl withFlexGrid dfbosse VB How-To 1 June 24th, 2003 12:20 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.