strWrt = new StringWriter(); htmText = new HtmlTextWriter(strWrt);base.Render(htmText);StringBuilder html = strWrt.GetStringBuilder();
try{System.Text.StringBuilder strBuilder = new System.Text.StringBuilder();System.IO.StringWriter strWrt = new System.IO.StringWriter(strBuilder);HtmlTextWriter htmText = new HtmlTextWriter(strWrt);//pnlMain is the Panel IDpnlMain.RenderControl(htmText);System.IO.StreamWriter strHtmlFile = System.IO.File.CreateText(Server.MapPath(“~/ValuationReport/”)+“Property-valuation-” + Session.SessionID+“.htm”);strHtmlFile.WriteLine(strBuilder.ToString());strHtmlFile.Close();Response.Redirect(“Payment1.aspx”);}catch (Exception exp) { Response.Write(exp.Message.ToString()); }