Render aspx page as a string
To render a page into a string use a StringWriter object. This can be useful when making AJAX type of queries. Using an aspx page for AJAX calls makes it easy to reference session state information.
System.IO.StringWriter htmlStringWriter = new System.IO.StringWriter();
Server.Execute("Page.aspx", htmlStringWriter);
string htmlOutput = htmlStringWriter.GetStringBuilder().ToString();