A question about user controls & alignment.

Discussion in 'ASP .Net Web Controls' started by Robert Koritnik, Jul 8, 2004.

  1. I have a rather complicated question that at first seems simple. Let's say
    you develop user controls consisting of a label, textbox (or any other input
    control) a "more" (the one with three dots - ellipsis) button and a set of
    hidden input boxes. Label on the left proceeded by the textbox (or...) and
    on the right a "more" button.

    The problem:
    If we look at the page it would consist of two columns of this kind of
    controls. A form with many controls of this kind (three visible elements)
    would display them in a table of 7 columns:
    - label
    - textbox (or...)
    - more button
    - separating column
    - label
    - textbox (or...)
    - more button

    Everything would be aligns. Labels, textboxes and more buttons. But if you
    need to build many user controls like this, a containing table would have 3
    columns:
    - control
    - separating column
    - control

    So the problem. How would you align these pieces of all user controls
    between each other? Fixed widths are not acceptable, while everything can
    get messy with different screen resolution setting in the system. All should
    be done using HTML w/o CSS...

    Any suggestion would be greatly appreciated.

    --
    RobertK
    { Clever? No just smart. }
     
    Robert Koritnik, Jul 8, 2004
    #1
    1. Advertising

  2. Robert Koritnik

    Scott G. Guest

    I'm not exactly sure what you are asking for; I think you are saying you have a control with three columns, wrapped in an HTML <table> and you want a group of them, so you would have a series of <table>s, thus how would you make sure they align, since the individual tables would align their own columns.

    If that's what you are asking, then I would change the control to generate just the <tr>stuff</tr> and then write a wrapper control that contains only these kinds of controls and it would generate the <table> ...child controls here.. </table>

    The better answer might be to create a templated control that you could get better control of the what you are generating (i.e. just create all of the controls but some delegate the actual presentation to another wrapper control....)

    If that's not what you are asking.... then ignore this :).

    Scott
    "Robert Koritnik" <> wrote in message news:...
    I have a rather complicated question that at first seems simple. Let's say
    you develop user controls consisting of a label, textbox (or any other input
    control) a "more" (the one with three dots - ellipsis) button and a set of
    hidden input boxes. Label on the left proceeded by the textbox (or...) and
    on the right a "more" button.

    The problem:
    If we look at the page it would consist of two columns of this kind of
    controls. A form with many controls of this kind (three visible elements)
    would display them in a table of 7 columns:
    - label
    - textbox (or...)
    - more button
    - separating column
    - label
    - textbox (or...)
    - more button

    Everything would be aligns. Labels, textboxes and more buttons. But if you
    need to build many user controls like this, a containing table would have 3
    columns:
    - control
    - separating column
    - control

    So the problem. How would you align these pieces of all user controls
    between each other? Fixed widths are not acceptable, while everything can
    get messy with different screen resolution setting in the system. All should
    be done using HTML w/o CSS...

    Any suggestion would be greatly appreciated.

    --
    RobertK
    { Clever? No just smart. }
     
    Scott G., Jul 11, 2004
    #2
    1. Advertising

  3. You understood my question perfectly... I was asking exactly that. Yes. I
    was thinking about TD solution so the control would only have the TD tags
    and align them in the placeholder. But that's something I would really like
    to avoid, because developer using those controls would have to have in mind
    that HE must create the table, tr elements and put inside those controls.
    Beside degner warnings/errors (maybe) because a table can contain only tr
    (ok also tbody etc...) elements and tr can only contain td elements... So.
    Making controls is beside reusability also a method to make usage of them to
    the developer as much transparent as possible.

    Once I did something simmilar with some control but it used javascript for
    alignment. I made a result list control, that had fixed header and
    scrollable results. And header had to align to results table. But I try to
    avoid javascript as much as possible. Aspecially here.

    Thans for your suggestions. But I was hoping of some totaly new approach
    here. Ifyou have any other suggestions, you're more than welcome to present
    more.

    --
    RobertK
    { Clever? No just smart. }


    "Scott G." <> wrote in message
    news:ux$...
    I'm not exactly sure what you are asking for; I think you are saying you
    have a control with three columns, wrapped in an HTML <table> and you want a
    group of them, so you would have a series of <table>s, thus how would you
    make sure they align, since the individual tables would align their own
    columns.

    If that's what you are asking, then I would change the control to generate
    just the <tr>stuff</tr> and then write a wrapper control that contains only
    these kinds of controls and it would generate the <table> ..child controls
    here.. </table>

    The better answer might be to create a templated control that you could get
    better control of the what you are generating (i.e. just create all of the
    controls but some delegate the actual presentation to another wrapper
    control....)

    If that's not what you are asking.... then ignore this :).

    Scott
    "Robert Koritnik" <> wrote in message
    news:...
    I have a rather complicated question that at first seems simple. Let's say
    you develop user controls consisting of a label, textbox (or any other
    input
    control) a "more" (the one with three dots - ellipsis) button and a set of
    hidden input boxes. Label on the left proceeded by the textbox (or...) and
    on the right a "more" button.

    The problem:
    If we look at the page it would consist of two columns of this kind of
    controls. A form with many controls of this kind (three visible elements)
    would display them in a table of 7 columns:
    - label
    - textbox (or...)
    - more button
    - separating column
    - label
    - textbox (or...)
    - more button

    Everything would be aligns. Labels, textboxes and more buttons. But if you
    need to build many user controls like this, a containing table would have
    3
    columns:
    - control
    - separating column
    - control

    So the problem. How would you align these pieces of all user controls
    between each other? Fixed widths are not acceptable, while everything can
    get messy with different screen resolution setting in the system. All
    should
    be done using HTML w/o CSS...

    Any suggestion would be greatly appreciated.

    --
    RobertK
    { Clever? No just smart. }
     
    Robert Koritnik, Jul 14, 2004
    #3
    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. =?Utf-8?B?U2FrZXQgTXVuZHJh?=

    Alignment of Controls(Header & Footer) on Web Form

    =?Utf-8?B?U2FrZXQgTXVuZHJh?=, Apr 15, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    533
    =?Utf-8?B?U2FrZXQgTXVuZHJh?=
    Apr 16, 2005
  2. Nathan Sokalski
    Replies:
    4
    Views:
    1,153
    Muhammad Naveed Yaseen
    Sep 5, 2007
  3. Faizan Ahmed
    Replies:
    1
    Views:
    291
    John Saunders
    Jan 4, 2005
  4. Amar

    User Control alignment problem in NS and Firefox

    Amar, Dec 6, 2004, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    109
  5. Faizan Ahmed
    Replies:
    1
    Views:
    370
    John Saunders
    Jan 4, 2005
Loading...

Share This Page