On/Off control

Discussion in 'ASP .Net Web Controls' started by Peter Zolja, Dec 10, 2003.

  1. Peter Zolja

    Peter Zolja Guest

    Hi guys,

    I am looking for a web control that would work in a similar way the Panel
    works, except that it should not include any DIV tags in the HTML. What I
    would like to do is to control blocks of HTML code from showing or not
    showing (on the server side), i.e. whether they are included in the final
    html code. The problem is that if I use the panel it inserts div tags, and
    some browsers have issues with div tags between table rows or columns. Is
    there a control that would do that, or a method to achieve this?

    Thanks,
    Peter.
    Peter Zolja, Dec 10, 2003
    #1
    1. Advertising

  2. Peter Zolja

    Sink Guest

    Hi,
    I ran into the same problem with the panel control and
    two ways of delaing with it on a row level are:

    1- Make sure you close previous tables, set your Panel
    width, and make the first line in your Panel
    another table def. Close the table right before the
    end panel. This seesm to work fine.

    2- Another way is to give a td an id and runat=server
    and then you can control whether or not the td is
    visible from the server. Collect some tds into a
    user defined On/OFF method and you have a panel.
    (with the second way, you don't need to worry about
    about closing and opening tables and it seems to
    work with any browser I have tried it on.)

    Regards
    Sink

    >-----Original Message-----
    >Hi guys,
    >
    >I am looking for a web control that would work in a

    similar way the Panel
    >works, except that it should not include any DIV tags in

    the HTML. What I
    >would like to do is to control blocks of HTML code from

    showing or not
    >showing (on the server side), i.e. whether they are

    included in the final
    >html code. The problem is that if I use the panel it

    inserts div tags, and
    >some browsers have issues with div tags between table

    rows or columns. Is
    >there a control that would do that, or a method to

    achieve this?
    >
    >Thanks,
    >Peter.
    >
    >
    >.
    >
    Sink, Dec 10, 2003
    #2
    1. Advertising

  3. Peter Zolja

    Sink Guest

    CORRECTION : tr not td

    Sorry,
    Type to fast sometimes

    // Synthetic Panel
    <tr id="Row1" runat="server">...</tr>
    <tr id="Row2" runat="server">...</tr>

    private void TogglePanel(bool switch)
    {
    if(!switch){
    Row1.Visible = false;
    Row2.Visible = false;
    }
    else {
    Row1.Visible = true;
    Row2.Visible = true;
    }

    Add a static property and you also could track it and
    switch from that.

    Sink
    >-----Original Message-----
    >Hi guys,
    >
    >I am looking for a web control that would work in a

    similar way the Panel
    >works, except that it should not include any DIV tags in

    the HTML. What I
    >would like to do is to control blocks of HTML code from

    showing or not
    >showing (on the server side), i.e. whether they are

    included in the final
    >html code. The problem is that if I use the panel it

    inserts div tags, and
    >some browsers have issues with div tags between table

    rows or columns. Is
    >there a control that would do that, or a method to

    achieve this?
    >
    >Thanks,
    >Peter.
    >
    >
    >.
    >
    Sink, Dec 11, 2003
    #3
  4. Peter Zolja

    Peter Zolja Guest

    Re: CORRECTION : tr not td

    > // Synthetic Panel
    > <tr id="Row1" runat="server">...</tr>
    > <tr id="Row2" runat="server">...</tr>


    That's awesome... I didn't know you can do that. The problem is that my
    table is inside a repeater and the id is changed for every row in the list,
    so I can't just call Row1 or Row2... As for your first suggestion
    unfortunately it won't work for me because I have several tables
    open/nested, and I am using the panel between rows, which is what confuses
    other browsers (IE has no problem with this).

    Thanks.
    Peter Zolja, Dec 11, 2003
    #4
    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?UGF1bA==?=

    How to get log off to work in a custom control

    =?Utf-8?B?UGF1bA==?=, Feb 2, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    328
    =?Utf-8?B?UGF1bA==?=
    Feb 3, 2005
  2. Steve
    Replies:
    0
    Views:
    438
    Steve
    Jan 31, 2006
  3. Wayne...
    Replies:
    15
    Views:
    747
    Toby Inkster
    Jul 23, 2004
  4. Peter v. N.
    Replies:
    3
    Views:
    343
    Thomas Matthews
    Nov 29, 2006
  5. robert112
    Replies:
    1
    Views:
    417
    Juan T. Llibre
    Apr 26, 2007
Loading...

Share This Page