Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Sizing and positioning of dynamic controls

Reply
Thread Tools

Sizing and positioning of dynamic controls

 
 
Tim Marsden
Guest
Posts: n/a
 
      02-25-2004
Hi

I would like to add controls to my page at runtime.
What containers can I use to host the controls?
I know I can add them to the form controls collection, but I need to have
control on where they are placed. For example I would like a page header and
footer, menu on the left, text on the right and an area in the middle where
I can add the controls, with the area sizing dynamically.

Hope you can suggest some options.

Tim


 
Reply With Quote
 
 
 
 
Steven Cheng[MSFT]
Guest
Posts: n/a
 
      02-26-2004
Hi Tim,


Thanks for posting in the community!
From your description, you're looking for some proper container controls to
hold in the ASP.NET web page so as to contain some other dynamically added
controls, yes?
If there is anything I misunderstood, please feel free to let me know.

As for this question, I think the PlaceHolder, Panel or html Div control
are all capable of doing this. But the PlaceHolder is more recommended. And
here are some references on them:

#PlaceHolder Web Server Control
http://msdn.microsoft.com/library/en...olderwebserver
control.asp?frame=true

#Panel Web Server Control
http://msdn.microsoft.com/library/en...ebcontrol.asp?
frame=true

Also, some additional tech meterials on dynamicaly adding server controls
on ASP.NET WEB FORM:
#Adding Controls to a Web Forms Page Programmatically
http://msdn.microsoft.com/library/en...controlstowebf
ormspageprogrammatically.asp?frame=true

Hope these helpful.



Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

 
Reply With Quote
 
 
 
 
Steven Cheng[MSFT]
Guest
Posts: n/a
 
      02-28-2004
Hi Tim,

Have had a a chance to check out my suggestions or have you got any ideas
on this issue? If you need any further help, please feel free to post here.'


Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

 
Reply With Quote
 
Tim Marsden
Guest
Posts: n/a
 
      02-29-2004
Steven

Thanks,

I have had a go at using place holders and panels, within a html table. If I
am clever at setting the widths of the controls I can achieve the results I
am after, that is controls in a vertical list, but it is not easy. I have
not been able to position absolutely within the panel or place holder.

FYI, I am trying to achieve varying number of rows of controls. Each row
will contain 3 columns, a label , a text box (or combo box) and a icon.


Tim



"Steven Cheng[MSFT]" <(E-Mail Removed)> wrote in message
news:K1lZhMe$(E-Mail Removed)...
> Hi Tim,
>
> Have had a a chance to check out my suggestions or have you got any ideas
> on this issue? If you need any further help, please feel free to post

here.'
>
>
> Regards,
>
> Steven Cheng
> Microsoft Online Support
>
> Get Secure! www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>
> Get Preview at ASP.NET whidbey
> http://msdn.microsoft.com/asp.net/whidbey/default.aspx
>



 
Reply With Quote
 
Steven Cheng[MSFT]
Guest
Posts: n/a
 
      03-02-2004
Hi Tim,

Thanks for your followup.
Yes, as you mentioned, to get and set the web control's width and heigth
are not quite easy especially to get them because a certain control in page
will derived its height and width from its parent container element
especially you explictly set them.

In addition, as for the:
"I am trying to achieve varying number of rows of controls. Each row
will contain 3 columns, a label , a text box (or combo box) and a icon."
you mentioned in last reply, do you mean that you'll dynamically add
several rows of controls and each row will contain three cell(has a certain
sub control in it)? If so, do you think it possbile to use the ASP.NET
Table control? We can dynamically add rows into Table Control also add
cells into each row dynamically. Here is the reference of Asp.net Table
server control in MSDN:

#Table, TableRow, and TableCell Web Server Controls
http://msdn.microsoft.com/library/en...ableRowTableCe
llWebControls.asp?frame=true



Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

 
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
Relative Positioning & Fixed Sizing in ASCX Controls Alex Maghen ASP .Net Web Controls 3 05-10-2006 12:56 PM
dynamic positioning of web controls =?Utf-8?B?UGF1bA==?= ASP .Net 4 05-31-2005 03:48 PM
Dynamic positioning Resizing of controls.... Mustufa Baig ASP .Net 1 11-18-2004 12:19 AM
Re: Positioning dynamic user controls on web forms at run-time Alessandro Zifiglio ASP .Net 0 02-10-2004 07:03 AM
Dynamic server controls and positioning ASP .Net 1 11-27-2003 03:40 PM



Advertisments