473,320 Members | 1,958 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,320 software developers and data experts.

Not able to load web user control dynamically in ASP .Net 2.0

I am not able to load and attach a web user control to a placeholder
dynamically in 2.0 beta.

Do I miss something?

Thanks
Nov 19 '05 #1
4 1377
fh
Atul Bahl wrote:
I am not able to load and attach a web user control to a placeholder
dynamically in 2.0 beta.

Do I miss something?

Thanks

toload your UC
instead of
myUc = new myUc();
placehloader.control.add(myUc);

do
myUC = LoadControl("pathToUserWebControl");
placehloader.control.add(myUc);
Nov 19 '05 #2
I have tried this but does not work.

Somehow the control will not show up. on the page. I also tried to add to
page but something is missing.

"fh" wrote:
Atul Bahl wrote:
I am not able to load and attach a web user control to a placeholder
dynamically in 2.0 beta.

Do I miss something?

Thanks

toload your UC
instead of
myUc = new myUc();
placehloader.control.add(myUc);

do
myUC = LoadControl("pathToUserWebControl");
placehloader.control.add(myUc);

Nov 19 '05 #3
Can you post some code? This does still work in 2.0.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Thu, 18 Aug 2005 07:45:07 -0700, Atul Bahl
<At******@discussions.microsoft.com> wrote:
I have tried this but does not work.

Somehow the control will not show up. on the page. I also tried to add to
page but something is missing.

"fh" wrote:
Atul Bahl wrote:
> I am not able to load and attach a web user control to a placeholder
> dynamically in 2.0 beta.
>
> Do I miss something?
>
> Thanks
>
>

toload your UC
instead of
myUc = new myUc();
placehloader.control.add(myUc);

do
myUC = LoadControl("pathToUserWebControl");
placehloader.control.add(myUc);


Nov 19 '05 #4
Thanks Allen,

Here is my code, it is exactly identical so if you say that it works then
pretty sure something is wrong at my end.

Page.LoadControl(pathtocontrol)
Placeholder.Controls.Add(abovecontrol);

Atul

"Scott Allen" wrote:
Can you post some code? This does still work in 2.0.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Thu, 18 Aug 2005 07:45:07 -0700, Atul Bahl
<At******@discussions.microsoft.com> wrote:
I have tried this but does not work.

Somehow the control will not show up. on the page. I also tried to add to
page but something is missing.

"fh" wrote:
Atul Bahl wrote:
> I am not able to load and attach a web user control to a placeholder
> dynamically in 2.0 beta.
>
> Do I miss something?
>
> Thanks
>
>
toload your UC
instead of
myUc = new myUc();
placehloader.control.add(myUc);

do
myUC = LoadControl("pathToUserWebControl");
placehloader.control.add(myUc);


Nov 19 '05 #5

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

Similar topics

0
by: Clement | last post by:
I have an user control(Control1) that dynamically adds another user control(Control2). In Control2, I am displaying data in a datagrid which I enable paging and sorting. When I click on the page...
1
by: Reza Nabi | last post by:
Bakground: I have a webform (LoadCtl.aspx) which loads the user control to a placeholder dynamically based on the ctlName querystring passed in the URL. Webform (LoadCtl.aspx) also passes a...
1
by: Green | last post by:
Hi, All I need to dynamically load a user control and change some properties on the user control, and display in the aspx page. Unfortunately I failed, nothing appears. Please help me look at,...
1
by: patrick.tsang | last post by:
Hi guys, I try to load a user control by using Page.LoadControl. // in aspx page Control l_oControl = Page.LoadControl("~/Controls/ucA.ascx"); ucA myUserControl = (ucA)l_oControl; ...
2
by: Nick | last post by:
I have two navigation user controls and based on a query string will load one or the other. On the page that will load the user control I cannot do the following Dim uc As FlashNavigation (The...
1
by: mazdotnet | last post by:
Hi, I have a user control that I add dynamically. Once certain action is performed I want to remove it completely. My questions are 1. How do you check to see if a user control already exists...
1
by: maflatoun | last post by:
Hi, I have a user control that I add dynamically. Once certain action is performed I want to remove it completely. My questions are 1. How do you check to see if a user control already exists...
2
by: Ronald S. Cook | last post by:
I have a Windows app with a split container (SplitContainer1) that contains two panels (Panel1, Panel2). I would like to load a user control (utcMyTest) into Panel2 on form load. Can someone...
0
by: xpnet | last post by:
Hi, I am using Mutliview control, and want to move a user control from one view to another view based on user selection. I can do this by placing a "Placeholder" control in each views. Based on...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.