Alternative to Panel Control

Discussion in 'ASP .Net' started by Guadala Harry, Apr 29, 2005.

  1. AFAIK, the Panel control renders as a <SPAN> in the rendered HTML.

    Is there an alternative to Panel that renders NOTHING?

    Here is what I'm doing:
    I need to place a bunch of HTML in an ASCX - but cause only some of it to be
    rendered based on runtime conditions. I currently have the behaviour I want,
    but by using multiple Panel controls that encompass the sections of HTML
    that are to be rendered. My code-behind logic makes sets the .visible
    property of the Panel controls.

    I just want to do the same thing - but not have the SPAN elementes show up
    in the rendered page.

    Thanks!
     
    Guadala Harry, Apr 29, 2005
    #1
    1. Advertising

  2. Guadala Harry

    Axel Dahmen Guest

    I have the same trouble. Using the asp:panel control is particularly
    pointless when you're trying to hide some table rows with it.

    Have you tried to create your own Panel control by deriving from the
    asp:panel control and overwriting its Render methods?

    HTH,
    Axel Dahmen



    -------------------
    "Guadala Harry" <> schrieb im Newsbeitrag
    news:...
    > AFAIK, the Panel control renders as a <SPAN> in the rendered HTML.
    >
    > Is there an alternative to Panel that renders NOTHING?
    >
    > Here is what I'm doing:
    > I need to place a bunch of HTML in an ASCX - but cause only some of it to

    be
    > rendered based on runtime conditions. I currently have the behaviour I

    want,
    > but by using multiple Panel controls that encompass the sections of HTML
    > that are to be rendered. My code-behind logic makes sets the .visible
    > property of the Panel controls.
    >
    > I just want to do the same thing - but not have the SPAN elementes show up
    > in the rendered page.
    >
    > Thanks!
    >
    >
     
    Axel Dahmen, Apr 29, 2005
    #2
    1. Advertising

  3. Patrick Olurotimi Ige, Apr 29, 2005
    #3
  4. Guadala Harry

    TJS Guest

    use the div tag

    <div id="whatever" Visible="true" runat="server"></div>

    "Guadala Harry" <> wrote in message
    news:...
    > AFAIK, the Panel control renders as a <SPAN> in the rendered HTML.
    >
    > Is there an alternative to Panel that renders NOTHING?
    >
    > Here is what I'm doing:
    > I need to place a bunch of HTML in an ASCX - but cause only some of it to
    > be rendered based on runtime conditions. I currently have the behaviour I
    > want, but by using multiple Panel controls that encompass the sections of
    > HTML that are to be rendered. My code-behind logic makes sets the .visible
    > property of the Panel controls.
    >
    > I just want to do the same thing - but not have the SPAN elementes show up
    > in the rendered page.
    >
    > Thanks!
    >
     
    TJS, Apr 29, 2005
    #4
  5. Guadala Harry

    Axel Dahmen Guest

    ....I should add that it's as simple as just deriving from asp:panel and add
    two empty render functions: RenderBeginTag() and RenderEndTag(). Then no
    <span></span> will be created.
     
    Axel Dahmen, Apr 29, 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. Harry
    Replies:
    3
    Views:
    569
    Harry Singh
    Nov 10, 2003
  2. HS1
    Replies:
    3
    Views:
    515
  3. HS1
    Replies:
    4
    Views:
    8,360
    Babu Kalakrishnan
    Dec 8, 2004
  4. Ulf Meinhardt
    Replies:
    0
    Views:
    649
    Ulf Meinhardt
    Jul 7, 2009
  5. Robin Wenger
    Replies:
    0
    Views:
    2,989
    Robin Wenger
    Aug 18, 2011
Loading...

Share This Page