Sizing and positioning of dynamic controls

Discussion in 'ASP .Net' started by Tim Marsden, Feb 25, 2004.

  1. Tim Marsden

    Tim Marsden Guest

    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
     
    Tim Marsden, Feb 25, 2004
    #1
    1. Advertising

  2. 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-us/vbcon/html/vboriplaceholderwebserver
    control.asp?frame=true

    #Panel Web Server Control
    http://msdn.microsoft.com/library/en-us/vbcon/html/vbconpanelwebcontrol.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-us/vbcon/html/vbtskaddingcontrolstowebf
    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
     
    Steven Cheng[MSFT], Feb 26, 2004
    #2
    1. Advertising

  3. 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
     
    Steven Cheng[MSFT], Feb 28, 2004
    #3
  4. Tim Marsden

    Tim Marsden Guest

    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]" <> wrote in message
    news:K1lZhMe$...
    > 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
    >
     
    Tim Marsden, Feb 29, 2004
    #4
  5. 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-us/vbcon/html/vbconTableTableRowTableCe
    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
     
    Steven Cheng[MSFT], Mar 2, 2004
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Guest
    Replies:
    1
    Views:
    369
    Tommy
    Nov 27, 2003
  2. Alessandro Zifiglio
    Replies:
    0
    Views:
    428
    Alessandro Zifiglio
    Feb 10, 2004
  3. Mustufa Baig
    Replies:
    1
    Views:
    437
    Jeffrey Palermo [MCP]
    Nov 18, 2004
  4. =?Utf-8?B?UGF1bA==?=

    dynamic positioning of web controls

    =?Utf-8?B?UGF1bA==?=, May 27, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    495
    =?Utf-8?B?UGF1bA==?=
    May 31, 2005
  5. Alex Maghen

    Relative Positioning & Fixed Sizing in ASCX Controls

    Alex Maghen, May 6, 2006, in forum: ASP .Net Web Controls
    Replies:
    3
    Views:
    379
    Steven Cheng[MSFT]
    May 10, 2006
Loading...

Share This Page