Is there a better approach to minify html generated from aspx page
<p>I am using the following code to minify html generated from aspx page duuring runtime.</p>

<pre><code>protected override void Render(HtmlTextWriter writer)
{
    TextWriter output = new StringWriter();
    base.Render(new HtmlTextWriter(output));
    String html = output.ToString();
    html = Regex.Replace(html, @"\n|\t", " ");
    html = Regex.Replace(html, @"&gt;\s+&lt;", "&gt;&lt;").Trim();
    html = Regex.Replace(html, @"\s{2,}", " ");

    writer.Write(html);
}
</code></pre>

<p>Is there more better approach to do the same.</p>

<p>Thank you so much.</p>
