473,396 Members | 2,030 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

add WebUserControls dynamically

hey all,
let's say i have a WebUserControl that has a GridView in it. i have a blank
web form on the page and in the code behind i'd like to dynamically create
that WebUserControl could someone please show me a good article or some
syntax to send the concept home for me?

thanks,
rodchar
Feb 12 '07 #1
2 2037
How about this
base.CreateChildControls();

Controls.Clear();

usercontrol =
(UserControl)Page.LoadControl(@"/ManagedUsercontrolLibrary/WebUserControl1.ascx");

Controls.Add(usercontrol);

Assuming you have a directory called managedusercontrollibrary and an ascx
file in it.
--
Regards,
Alvin Bruney
------------------------------------------------------
Shameless author plug
Excel Services for .NET is coming...
OWC Black book on Amazon and
www.lulu.com/owc
Professional VSTO 2005 - Wrox/Wiley
"rodchar" <ro*****@discussions.microsoft.comwrote in message
news:D9**********************************@microsof t.com...
hey all,
let's say i have a WebUserControl that has a GridView in it. i have a
blank
web form on the page and in the code behind i'd like to dynamically create
that WebUserControl could someone please show me a good article or some
syntax to send the concept home for me?

thanks,
rodchar

Feb 13 '07 #2
i figured all i would have to do is istantiate the WebUserControl and i'd be
"good to go"?

"Alvin Bruney [MVP]" wrote:
How about this
base.CreateChildControls();

Controls.Clear();

usercontrol =
(UserControl)Page.LoadControl(@"/ManagedUsercontrolLibrary/WebUserControl1.ascx");

Controls.Add(usercontrol);

Assuming you have a directory called managedusercontrollibrary and an ascx
file in it.
--
Regards,
Alvin Bruney
------------------------------------------------------
Shameless author plug
Excel Services for .NET is coming...
OWC Black book on Amazon and
www.lulu.com/owc
Professional VSTO 2005 - Wrox/Wiley
"rodchar" <ro*****@discussions.microsoft.comwrote in message
news:D9**********************************@microsof t.com...
hey all,
let's say i have a WebUserControl that has a GridView in it. i have a
blank
web form on the page and in the code behind i'd like to dynamically create
that WebUserControl could someone please show me a good article or some
syntax to send the concept home for me?

thanks,
rodchar


Feb 13 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Arjen | last post by:
Hello, I'm working on multiple webusercontrols which i'm using after each other. Now I have placed one webusercontrol on a webpage. How can I hide this one (after some action) and load an...
2
by: tony | last post by:
hi. is there a way to write several webusercontrols in 1 file ? i want to write 3 diffrent webusercontrol for each table. but i want to see the code in 1 file. is it possible ?
7
by: pmclinn | last post by:
I was wondering if it is possible to dynamically create a structure. Something like this: public sub main sql = "Select Col1, Col2 from Table a" dim al as new arraylist al =...
2
by: jesusR | last post by:
In VS2003 (framework 1.1 or less) i was shareing my webusercontrols with this procedure: I created a web project (webusercontrol_project) with the web user control, i compiled and everything ok....
0
by: Johnny Emde Jensen | last post by:
Hello USING VB.NET In VS 2003 I did this to dynamically add a webusercontrol Private objControl as MyWebControl = nothing Private Sub ShowControl() objControl =...
1
by: GenCode | last post by:
I am trying to create a page with many of the same webusercontrols that I can have all my dynamically created and I want each of those webusercontrols to respong to one event on the page. How...
2
by: Formentz | last post by:
Hi Guys, I am very new to ASP.NET. Is it possible to create a DLL with WebForms and WebUserControls in it, and then to use that forms and controls in a web application? I come from Windows...
1
by: ysudhakarrao | last post by:
Hi i am having two pages main.aspx and popupwindow.aspx .In main.aspx i am having tabpanel and button.popupwindow.aspx iam having listbox ie collection of webusercontrols.after click of that...
2
by: Andy B | last post by:
I am making a WebUserControl that creates a dataset dynamically. There are multiple steps for each table of the dataset where each step is a different view of a MultiView control. Do I need to use...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.