Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > positioning dynamically created controls

Reply
Thread Tools

positioning dynamically created controls

 
 
Smokey Grindel
Guest
Posts: n/a
 
      10-04-2006
I have a web control library that of course renders custom html... I want to
place what it outputs into a div on the page.. how do I tell it to place
this dynamically created custom control into a div? so its placed in the
correct location on the form? thanks!


 
Reply With Quote
 
 
 
 
Chris Fulstow
Guest
Posts: n/a
 
      10-04-2006
You need to put a placeholder control inside your <div>, then
dynamically add your web control to the placeholder.

<asplaceHolder id="PlaceHolder1" runat="server"/>

PlaceHolder1.Controls.Add(myWebControl);

More info here:
http://msdn2.microsoft.com/en-US/lib...aceholder.aspx

Smokey Grindel wrote:
> I have a web control library that of course renders custom html... I want to
> place what it outputs into a div on the page.. how do I tell it to place
> this dynamically created custom control into a div? so its placed in the
> correct location on the form? thanks!


 
Reply With Quote
 
 
 
 
Smokey Grindel
Guest
Posts: n/a
 
      10-04-2006
ah thank you! didnt think it was so simple... or maybe im just getting
old...

"Chris Fulstow" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> You need to put a placeholder control inside your <div>, then
> dynamically add your web control to the placeholder.
>
> <asplaceHolder id="PlaceHolder1" runat="server"/>
>
> PlaceHolder1.Controls.Add(myWebControl);
>
> More info here:
> http://msdn2.microsoft.com/en-US/lib...aceholder.aspx
>
> Smokey Grindel wrote:
>> I have a web control library that of course renders custom html... I want
>> to
>> place what it outputs into a div on the page.. how do I tell it to place
>> this dynamically created custom control into a div? so its placed in the
>> correct location on the form? thanks!

>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Affecting a dynamically created drop down from another dynamically created drop down. msimmons ASP .Net 0 07-16-2009 03:17 PM
Managing ViewState of a dynamically created Custom Composite Server Control -(where the original is also dynamically created) dickster ASP .Net Building Controls 0 12-08-2005 09:32 AM
Positioning dynamically created controls Guy ASP .Net Web Controls 2 12-23-2004 10:53 AM
retrieving values from controls dynamically created in a <asp:table> Bryan Donaldson ASP .Net 0 11-24-2003 06:29 PM
Positioning Dynamically added controls Harry ASP .Net 1 06-25-2003 06:08 AM



Advertisments