Using System;
Using System. Collections. Generic;
Using System. Web;
Using System. IO;
Using System. Text. RegularExpressions;
Using System. Web. UI;
/// <Summary>
/// Summary description for StaticPageInfo
/// </Summary>
Public class StaticPageInfo: System. Web. UI. Page
{
Protected override void Render (HtmlTextWriter writer)
{
StringWriter sw = new StringWriter ();
Base. Render (new HtmlTextWriter (sw ));
String html = sw. ToString ();
Html = ReplaceView (html );
Writer. WriteLine (html. Trim ());
}
Public string ReplaceView (string BodyHtml)
{
BodyHtml = Regex. Replace (BodyHtml, @ "<form ([\ s | \ S] *?)> ([\ S | \ S] *?) </Form> ", @" $2 ", RegexOptions. IgnoreCase );
BodyHtml = Regex. Replace (BodyHtml, @ "<input type =" "hidden" "name =" "_ VIEWSTATE" "([\ s | \ S] *?) /> ", @" ", RegexOptions. IgnoreCase );
BodyHtml = Regex. Replace (BodyHtml, @ "<input type =" "hidden" "name =" "_ EVENTVALIDATION" "([\ s | \ S] *?) /> ", @" ", RegexOptions. IgnoreCase );
BodyHtml = Regex. Replace (BodyHtml, @ "<form ([\ s | \ S] *?)> ([\ S | \ S] *?) </Form> ", @" $2 ", RegexOptions. IgnoreCase );
Return BodyHtml;
}
}