Hello,
I want to generated and get html using following method but it is giving error that "Error executing child request". Kindly advice any solution
/// This method generate html of the page
/// </summary>
/// <param name="pagename">Name of the page</param>
/// <returns>Return content of the page in html format</returns>
public static string GetPageContent(string pagename)
{
try
{
//Creating Memory Stream
MemoryStream m = new MemoryStream();
//Create Stream Writer to Write Contents of Recipt Page
StreamWriter wr = new StreamWriter(m);
//Getting Recipt Page
HttpContext.Current.Server.Execute(pagename, wr);
// Setting Memory Stream at the start
m.Position = 0;
// Initializing Message String
string receiptContent = "";
//Creating Stream Reader to Read Contents from Memory Strean
StreamReader s = new StreamReader(m);
// Getting the entire page from the string
receiptContent += s.ReadToEnd();
s.Close();
return MailManager.GetUpdatedContent_byGCLID(receiptContent);
}