By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,007 Members | 1,033 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,007 IT Pros & Developers. It's quick & easy.

Sizing and positioning of dynamic controls

P: n/a
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
Nov 18 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
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

Nov 18 '05 #2

P: n/a
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

Nov 18 '05 #3

P: n/a
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]" <v-******@online.microsoft.com> wrote in message
news:K1*************@cpmsftngxa06.phx.gbl...
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

Nov 18 '05 #4

P: n/a
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

Nov 18 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.