Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Building Controls > place WebUserControl in X, Y location

Reply
Thread Tools

place WebUserControl in X, Y location

 
 
Dave Johnson
Guest
Posts: n/a
 
      12-14-2005
i built nested UserControls, and the parent control dynamicly generate
the child contorls, but i have a problem with positioning them on the
control page, how is it done for WebUseControl, i am sure its very
simple and basic Question but as i am new to usercontrols help will be
very appreciated if given multiple ways if there is more than one way.

thanks,


Sharing makes All the Difference

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com
 
Reply With Quote
 
 
 
 
Daniel TIZON
Guest
Posts: n/a
 
      12-16-2005
Hi Dave,
To place a WebUserControls dynamicaly on the page you should :
- place a static Container Control, a <ASPlaceHolder> or a <ASPanel>
control on the page.
- create an instance of the UserControl by using the LoadControl method
MyUserControl MyUC =
(MyUserControl)Page.LoadControl("WUC/MyUserControl.ascx");
- pass the parameters
MyUC.param1="hello";
- Add the control to the controls collection of your container.
MyPanel.Controls.add(MyUC);

If you want to place the control to x,y coordonates, I advise to use the
Panel as a container and to add Styles
MyPanel.Style.Add("position","absolute");
MyPanel.Style.Add("left","296px");
MyPanel.Style.Add("top","159px");

Hope this helps !

--
Daniel TIZON
MCP - MCSD.NET - MCT


"Dave Johnson" <(E-Mail Removed)> a écrit dans le message de news:
http://www.velocityreviews.com/forums/(E-Mail Removed)...
>i built nested UserControls, and the parent control dynamicly generate
> the child contorls, but i have a problem with positioning them on the
> control page, how is it done for WebUseControl, i am sure its very
> simple and basic Question but as i am new to usercontrols help will be
> very appreciated if given multiple ways if there is more than one way.
>
> thanks,
>
>
> Sharing makes All the Difference
>
> --
> Sent via .NET Newsgroups
> http://www.dotnetnewsgroups.com



 
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
Location, location, location =?Utf-8?B?VHJhY2V5?= Wireless Networking 2 02-17-2007 08:37 PM
need help to place my gem in proper location Mohammad Khan Ruby 3 01-10-2006 03:55 AM
Re: can NOT change the position of a WebUserControl on page Rick Spiewak ASP .Net 1 07-24-2003 10:16 PM
Viewstate of WebUserControl does NOT work Christian ASP .Net 2 07-15-2003 03:48 PM
Re: click event does not occur in webusercontrol Simon Storr ASP .Net 0 07-14-2003 09:52 AM



Advertisments