How to remove indent of ASP.NET Server Controls

Discussion in 'ASP .Net Building Controls' started by MumHa, Dec 7, 2005.

  1. MumHa

    MumHa Guest

    Hi,

    I created a new webcontrol that inherited from CompositeControl, and on
    override of CreateChildControls() I added Panels.
    When I view html source code on browser, the source code was indented,
    but I dont want.

    How I remove the indent?

    Regards,

    Rafael L.
     
    MumHa, Dec 7, 2005
    #1
    1. Advertisements

  2. override the render method. load all the text into a stringbuilder remove
    the tabs and write it to the HtmlWriter parameter of the render method.

    --
    Daniel Fisher(lennybacon)
    http://www.lennybacon.com


    "MumHa" <> wrote in message
    news:...
    > Hi,
    >
    > I created a new webcontrol that inherited from CompositeControl, and on
    > override of CreateChildControls() I added Panels.
    > When I view html source code on browser, the source code was indented,
    > but I dont want.
    >
    > How I remove the indent?
    >
    > Regards,
    >
    > Rafael L.
    >
     
    Daniel Fisher\(lennybacon\), Dec 7, 2005
    #2
    1. Advertisements

  3. MumHa

    Riki Guest

    "MumHa" <> wrote in message
    news:...
    > Hi,
    >
    > I created a new webcontrol that inherited from CompositeControl, and on
    > override of CreateChildControls() I added Panels.
    > When I view html source code on browser, the source code was indented,
    > but I dont want.
    >
    > How I remove the indent?


    Apart from Daniel's solution, you could also try using PlaceHolders instead
    of Panels.
    Panels generate <div> tags in most browsers, but PlaceHolders don't.

    --

    Riki
     
    Riki, Dec 7, 2005
    #3
    1. Advertisements

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. dx
    Replies:
    10
    Views:
    1,133
    John Saunders
    Apr 11, 2004
  2. =?Utf-8?B?bG9uZG9uIGNhbGxpbmc=?=

    force asp.net to remove cached page literals asp.net 1.1

    =?Utf-8?B?bG9uZG9uIGNhbGxpbmc=?=, Jul 4, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    681
    =?Utf-8?B?bG9uZG9uIGNhbGxpbmc=?=
    Jul 5, 2005
  3. Brad Gillespie

    Eclipse how to remove auto-indent....

    Brad Gillespie, Aug 25, 2003, in forum: Java
    Replies:
    0
    Views:
    3,186
    Brad Gillespie
    Aug 25, 2003
  4. SP
    Replies:
    2
    Views:
    622
  5. CEFM

    <ul> Remove Indent

    CEFM, Apr 25, 2005, in forum: HTML
    Replies:
    2
    Views:
    42,329
    Toby Inkster
    Apr 25, 2005
  6. Bob Rock
    Replies:
    1
    Views:
    893
    Cowboy \(Gregory A. Beamer\)
    Sep 17, 2006
  7. dt
    Replies:
    4
    Views:
    740
    CBFalconer
    Dec 31, 2006
  8. lotusshiv

    Indent text items in a ListBox Web Control in ASP.Net 1.0

    lotusshiv, Apr 27, 2006, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    339
    lotusshiv
    Apr 27, 2006
Loading...