Hiding table rows at run time in vb.net

Discussion in 'ASP .Net' started by Garg, Feb 15, 2007.

  1. Garg

    Garg Guest

    How do I hide a paricular tablerow during run time?

    I have two table rows with ids row1 and row2.
    I want that if a particualr condition is true, then row 1 should be
    displayed on the web page, otherwise row2 should be dispalyed.

    I tried following code, but it is not working:

    row1.Style.Value = "block"
    row2.Style.Value="None"

    But, still both the rows are being displayed. How do I achieve the
    desired functioanlity of hiding one row while displaying teh other row
    at run-time.

    Please help me with this....
    Garg, Feb 15, 2007
    #1
    1. Advertising

  2. On Feb 15, 8:15 am, "Garg" <> wrote:
    > How do I hide a paricular tablerow during run time?
    >
    > I have two table rows with ids row1 and row2.
    > I want that if a particualr condition is true, then row 1 should be
    > displayed on the web page, otherwise row2 should be dispalyed.
    >
    > I tried following code, but it is not working:
    >
    > row1.Style.Value = "block"
    > row2.Style.Value="None"


    row1.Style.Add("display", "none"); for instance...!
    But for this operation you would normally want to build that table
    dynamically and then DON'T build the rows that's not supposed to be
    shown...
    Preferable with some Ajax Framework...!!

    ..t

    --
    http://ajaxwidgets.com
    Free ASP.NET Ajax Widgets NOW!
    Thomas Hansen, Feb 15, 2007
    #2
    1. Advertising

  3. row1.Style("display")= "none"

    --
    Eliyahu Goldin,
    Software Developer & Consultant
    Microsoft MVP [ASP.NET]
    http://msmvps.com/blogs/egoldin
    http://usableasp.net


    "Garg" <> wrote in message
    news:...
    > How do I hide a paricular tablerow during run time?
    >
    > I have two table rows with ids row1 and row2.
    > I want that if a particualr condition is true, then row 1 should be
    > displayed on the web page, otherwise row2 should be dispalyed.
    >
    > I tried following code, but it is not working:
    >
    > row1.Style.Value = "block"
    > row2.Style.Value="None"
    >
    > But, still both the rows are being displayed. How do I achieve the
    > desired functioanlity of hiding one row while displaying teh other row
    > at run-time.
    >
    > Please help me with this....
    >
    Eliyahu Goldin, Feb 15, 2007
    #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. MattB

    hiding table rows by id?

    MattB, Mar 9, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    12,345
    MattB
    Mar 9, 2005
  2. luna

    Hiding table rows .asp

    luna, Jan 17, 2007, in forum: ASP .Net
    Replies:
    0
    Views:
    419
  3. chris f

    Hiding rows in an ASP.NET table

    chris f, Jun 11, 2008, in forum: ASP .Net
    Replies:
    2
    Views:
    1,580
    Munna
    Jun 11, 2008
  4. Rick Measham

    Hiding multiple rows in a dynamic table

    Rick Measham, Sep 23, 2003, in forum: Javascript
    Replies:
    1
    Views:
    241
    Martin Honnen
    Sep 23, 2003
  5. F. Da Costa

    Hiding rows in a table via <div>

    F. Da Costa, Dec 3, 2003, in forum: Javascript
    Replies:
    8
    Views:
    185
    F. Da Costa
    Dec 5, 2003
Loading...

Share This Page