I don't think there is a way to do it automatically, but it's simple enough
to implement.
This is the approach I use:
I have a base class derived from System.Web.UI.Page and override Render
namespace DoNot.Invade.MySpace
{
class Page : System.Web.UI.Page
{
protected override void Render(HtmlTextWriter writer)
{
StringBuilder sb = new StringBuilder();
StringWriter sw = new StringWriter(sb);
HtmlTextWriter hw = new HtmlTextWriter(sw);
base.Render (hw);
string html = sb.ToString();
html = html.Replace(Environment.NewLine, string.Empty);
html = html.Replace("\n", string.Empty); // This may be redundant
html = html.Replace("\t", string.Empty);
writer.Write(html);
}
}
}
Hope this helps
Brian W
"vMike" <Mi************@gewarren.com.nospam> wrote in message
news:bn**********@ngspool-d02.news.aol.com...
Is there any benefit to stripping all the space from the page before
rendering by overriding the page render and using the htmltextwriter and
stringbuilder to strip linefeeds, tabs and extra space etc. I have noticed
that may site's source code is like this. Is this because it is better for
the browser or harder for someone to be able to read it. Or maybe there is
a method or command to do this automatically?
Any thoughts are appreciated.
Mike