Nested controls in custom tab control

Discussion in 'ASP .Net' started by Marius Trælnes, Jan 3, 2005.

  1. Hello!

    I am about to make a class/control that creates tabbing functionality. The
    result is in HTML/CSS/JavaScript output.

    My question is: Within the tabs I want to simply add user controls and
    without loosing viewstate etc etc. How can this be done? What is best
    practice?

    I guess the answer for my question lies in how I design/develop the tab
    class/control. One solutions might simply to have a placeholder created for
    each tab (and then the usercontrol to be in that tab added to the
    placeholder).

    Any comments/suggestions appreciated.

    Marius
    Marius Trælnes, Jan 3, 2005
    #1
    1. Advertising

  2. Hi,

    My suggestion is the next.
    I think a tabbed control is "just" a serie of labels displayed in a peculiar
    way.
    That is to say, a tabbed control can be composed of

    <ul><li>tab1</li><li>tab2</li><li>tab3</li></ul> (this example was the
    choice of Scott Watermasysk http://www.scottwater.com)

    After that, you must specify styles for each tag (this is the hard work) and
    create a style for selected tab if you want to handle a persistable
    seletected tab or when the mouse pointer hovers it.

    I suggest you to take a look at scott site because i think it's a very good
    example of how to use css.

    Hope this helps!
    Regards,
    Franck Quintana
    Active+ Software
    http://www.activeplus.com


    "Marius Trælnes" <> wrote in message
    news:...
    | Hello!
    |
    | I am about to make a class/control that creates tabbing functionality. The
    | result is in HTML/CSS/JavaScript output.
    |
    | My question is: Within the tabs I want to simply add user controls and
    | without loosing viewstate etc etc. How can this be done? What is best
    | practice?
    |
    | I guess the answer for my question lies in how I design/develop the tab
    | class/control. One solutions might simply to have a placeholder created
    for
    | each tab (and then the usercontrol to be in that tab added to the
    | placeholder).
    |
    | Any comments/suggestions appreciated.
    |
    | Marius
    |
    |
    Franck Quintana, Jan 3, 2005
    #2
    1. Advertising

  3. Hello Franck,

    This was not an answer to my question. How to make the tab control i know. I
    asked about how to add existing user controls into the custom tab control.
    Forget the tab control if that is confusing. How to add existing user
    controls into some dynamic generated html then. What is the best approach?

    Thanks for trying though...

    Marius

    "Franck Quintana" <> wrote in message
    news:41d9561a$0$3515$...
    > Hi,
    >
    > My suggestion is the next.
    > I think a tabbed control is "just" a serie of labels displayed in a

    peculiar
    > way.
    > That is to say, a tabbed control can be composed of
    >
    > <ul><li>tab1</li><li>tab2</li><li>tab3</li></ul> (this example was the
    > choice of Scott Watermasysk http://www.scottwater.com)
    >
    > After that, you must specify styles for each tag (this is the hard work)

    and
    > create a style for selected tab if you want to handle a persistable
    > seletected tab or when the mouse pointer hovers it.
    >
    > I suggest you to take a look at scott site because i think it's a very

    good
    > example of how to use css.
    >
    > Hope this helps!
    > Regards,
    > Franck Quintana
    > Active+ Software
    > http://www.activeplus.com
    >
    >
    > "Marius Trælnes" <> wrote in message
    > news:...
    > | Hello!
    > |
    > | I am about to make a class/control that creates tabbing functionality.

    The
    > | result is in HTML/CSS/JavaScript output.
    > |
    > | My question is: Within the tabs I want to simply add user controls and
    > | without loosing viewstate etc etc. How can this be done? What is best
    > | practice?
    > |
    > | I guess the answer for my question lies in how I design/develop the tab
    > | class/control. One solutions might simply to have a placeholder created
    > for
    > | each tab (and then the usercontrol to be in that tab added to the
    > | placeholder).
    > |
    > | Any comments/suggestions appreciated.
    > |
    > | Marius
    > |
    > |
    >
    Marius Trælnes, Jan 3, 2005
    #3
  4. Marius Trælnes

    bruce barker Guest

    just add them to your Controls collection (and render your children). you do
    no need a placeholder, because your tab control can be placed on the form.

    -- bruce (sqlwork.com)


    "Marius Trælnes" <> wrote in message
    news:%...
    | Hello Franck,
    |
    | This was not an answer to my question. How to make the tab control i know.
    I
    | asked about how to add existing user controls into the custom tab control.
    | Forget the tab control if that is confusing. How to add existing user
    | controls into some dynamic generated html then. What is the best approach?
    |
    | Thanks for trying though...
    |
    | Marius
    |
    | "Franck Quintana" <> wrote in message
    | news:41d9561a$0$3515$...
    | > Hi,
    | >
    | > My suggestion is the next.
    | > I think a tabbed control is "just" a serie of labels displayed in a
    | peculiar
    | > way.
    | > That is to say, a tabbed control can be composed of
    | >
    | > <ul><li>tab1</li><li>tab2</li><li>tab3</li></ul> (this example was the
    | > choice of Scott Watermasysk http://www.scottwater.com)
    | >
    | > After that, you must specify styles for each tag (this is the hard work)
    | and
    | > create a style for selected tab if you want to handle a persistable
    | > seletected tab or when the mouse pointer hovers it.
    | >
    | > I suggest you to take a look at scott site because i think it's a very
    | good
    | > example of how to use css.
    | >
    | > Hope this helps!
    | > Regards,
    | > Franck Quintana
    | > Active+ Software
    | > http://www.activeplus.com
    | >
    | >
    | > "Marius Trælnes" <> wrote in message
    | > news:...
    | > | Hello!
    | > |
    | > | I am about to make a class/control that creates tabbing functionality.
    | The
    | > | result is in HTML/CSS/JavaScript output.
    | > |
    | > | My question is: Within the tabs I want to simply add user controls and
    | > | without loosing viewstate etc etc. How can this be done? What is best
    | > | practice?
    | > |
    | > | I guess the answer for my question lies in how I design/develop the
    tab
    | > | class/control. One solutions might simply to have a placeholder
    created
    | > for
    | > | each tab (and then the usercontrol to be in that tab added to the
    | > | placeholder).
    | > |
    | > | Any comments/suggestions appreciated.
    | > |
    | > | Marius
    | > |
    | > |
    | >
    |
    |
    bruce barker, Jan 3, 2005
    #4
  5. Ok, thank you for your tip. I still cannot see how this can be done without
    placdholder (problably since I have only used that before).

    Here is description of how I think this could be solved and my doubts:

    1. A tab user control is made. There is some codebehind code there to create
    correct client code (html/css/javascript). On each tab in that control there
    should be possible to add other user controls (based on some properties to
    be set when creating the user control).
    2. This tab user control is placed on a web form (id = tabctrl1) and
    "tab1Control" property is set to "testctrl.ascx".
    3. At runtime the tab user controls then add the control "testctrl.ascx" in
    the area of tab1. Here is doubt, and here are the approach I can think of:
    Using control collection I can add the control as follows:
    tabctrl1.Controls.Add(LoadControl("testctrl.ascx")). But here are 1 problem:
    How to place this correct in the tab controls html output (here is a lot of
    html/css/javascript created dynamically...). Here I only see that this can
    be done by placing a placeholder where tab1 area is (or a panel control
    could also to the work...)

    Please let me know if I am missing something.

    (of course, if I knew upfront what controls should be in each tab none of
    this would be a problem, it is that it should be dynamically loaded that is
    the "problem")

    Marius


    "bruce barker" <> skrev i melding
    news:...
    > just add them to your Controls collection (and render your children). you
    > do
    > no need a placeholder, because your tab control can be placed on the form.
    >
    > -- bruce (sqlwork.com)
    >
    >
    > "Marius Trælnes" <> wrote in message
    > news:%...
    > | Hello Franck,
    > |
    > | This was not an answer to my question. How to make the tab control i
    > know.
    > I
    > | asked about how to add existing user controls into the custom tab
    > control.
    > | Forget the tab control if that is confusing. How to add existing user
    > | controls into some dynamic generated html then. What is the best
    > approach?
    > |
    > | Thanks for trying though...
    > |
    > | Marius
    > |
    > | "Franck Quintana" <> wrote in message
    > | news:41d9561a$0$3515$...
    > | > Hi,
    > | >
    > | > My suggestion is the next.
    > | > I think a tabbed control is "just" a serie of labels displayed in a
    > | peculiar
    > | > way.
    > | > That is to say, a tabbed control can be composed of
    > | >
    > | > <ul><li>tab1</li><li>tab2</li><li>tab3</li></ul> (this example was the
    > | > choice of Scott Watermasysk http://www.scottwater.com)
    > | >
    > | > After that, you must specify styles for each tag (this is the hard
    > work)
    > | and
    > | > create a style for selected tab if you want to handle a persistable
    > | > seletected tab or when the mouse pointer hovers it.
    > | >
    > | > I suggest you to take a look at scott site because i think it's a very
    > | good
    > | > example of how to use css.
    > | >
    > | > Hope this helps!
    > | > Regards,
    > | > Franck Quintana
    > | > Active+ Software
    > | > http://www.activeplus.com
    > | >
    > | >
    > | > "Marius Trælnes" <> wrote in
    > message
    > | > news:...
    > | > | Hello!
    > | > |
    > | > | I am about to make a class/control that creates tabbing
    > functionality.
    > | The
    > | > | result is in HTML/CSS/JavaScript output.
    > | > |
    > | > | My question is: Within the tabs I want to simply add user controls
    > and
    > | > | without loosing viewstate etc etc. How can this be done? What is
    > best
    > | > | practice?
    > | > |
    > | > | I guess the answer for my question lies in how I design/develop the
    > tab
    > | > | class/control. One solutions might simply to have a placeholder
    > created
    > | > for
    > | > | each tab (and then the usercontrol to be in that tab added to the
    > | > | placeholder).
    > | > |
    > | > | Any comments/suggestions appreciated.
    > | > |
    > | > | Marius
    > | > |
    > | > |
    > | >
    > |
    > |
    >
    >
    Henrik Larsen, Jan 3, 2005
    #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. Hermit Dave
    Replies:
    0
    Views:
    433
    Hermit Dave
    Jan 22, 2004
  2. Dakota2030
    Replies:
    0
    Views:
    485
    Dakota2030
    Mar 11, 2005
  3. Peter Rilling

    nested controls in a custom control.

    Peter Rilling, Mar 26, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    369
    Jon Paal [MSMD]
    Mar 26, 2007
  4. rodchar
    Replies:
    0
    Views:
    392
    rodchar
    Nov 26, 2007
  5. Brook

    Custom Control, ITemplate and nested bound controls

    Brook, Mar 17, 2008, in forum: ASP .Net Web Controls
    Replies:
    4
    Views:
    437
    Brook
    Mar 25, 2008
Loading...

Share This Page