Friday, May 23, 2008

How to get generated html of a page and change it.

public override void Render(System.Web.UI.HtmlTextWriter writer)
{
    StringBuilder sb = new StringBuilder();
    HtmlTextWriter htw = new HtmlTextWriter(new StringWriter(sb));
    base.Render(htw);
    string html = sb.ToString();
    ///
    /// Example
    /// 
    html.Replace("<b>""<strong>");
    html.Replace("</b>""</strong>");
    /// 
    /// Insert the meta tags
    /// Insert webtrends meta tags
    /// Move hidden system inserted fields
    /// Move viewstate
    /// Perform SEO checks
    /// And finally, write the HTML to original writer
    writer.Write(html);
}

No comments:

Azure Storage Account Types

Defferent Types of Blobs Block blobs store text and binary data. Block blobs are made up of blocks of data that can be managed individually...