How to remove indent of ASP.NET Server Controls

M

MumHa

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.
 
D

Daniel Fisher\(lennybacon\)

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.
 
R

Riki

MumHa said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,038
Latest member
OrderProperKetocapsules

Latest Threads

Top