Click here to Skip to main content
15,922,155 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Microsoft JScript runtime error:
JavaScript
Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.
Details: Error parsing near '<html xmlns='http://'.

what is the solution on this type of error
Posted
Updated 13-Feb-12 23:24pm
v2
Comments
CRDave1988 14-Feb-12 5:29am    
can u show us ur code?
dA.d 14-Feb-12 5:36am    
public static string ConvertToHtmlFile(DataTable targetTable)
{
string myHtmlFile = "";

if ((targetTable == null))
{
throw new System.ArgumentNullException("targetTable");
}
else
{
//Continue.
}

//Get a worker object.
System.Text.StringBuilder myBuilder = new System.Text.StringBuilder();

//Open tags and write the top portion.
myBuilder.Append("<html xmlns='http://www.w3.org/1999/xhtml'>");
myBuilder.Append("<head>");
myBuilder.Append("<title>");
myBuilder.Append("Page-");
myBuilder.Append(Guid.NewGuid().ToString());
myBuilder.Append("</title>");
myBuilder.Append("</head>");
myBuilder.Append("<body>");
myBuilder.Append("<table border='1px' cellpadding='5' cellspacing='0' ");
myBuilder.Append("style='border: solid 1px Silver; font-size: x-small;'>");

//Add the headings row.

myBuilder.Append("<tr align='left' valign='top'>");

foreach (DataColumn myColumn in targetTable.Columns)
{
myBuilder.Append("<td align='left' valign='top'");
myBuilder.Append(myColumn.ColumnName);
myBuilder.Append("");
}

myBuilder.Append("</tr>");


//Add the data rows.
foreach (DataRow myRow in targetTable.Rows)
{
myBuilder.Append("<tr align='left' valign='top'>");

foreach (DataColumn myColumn in targetTable.Columns)
{
myBuilder.Append("<td align='left' valign='top'>");
myBuilder.Append(myRow[myColumn.ColumnName].ToString());
myBuilder.Append("</td>");
}

myBuilder.Append("</tr>");
}

//Close tags.
myBuilder.Append("</table>");
myBuilder.Append("</body>");
myBuilder.Append("</html>");

//Get the string for return.
myHtmlFile = myBuilder.ToString();

return myHtmlFile;
}
above is my code but error occur in this line in my code "myBuilder.Append("<html xmlns='http://www.w3.org/1999/xhtml'>");"
CRDave1988 14-Feb-12 5:50am    
according to my idea error is not at myBuilder.Append("<html xmlns='http://www.w3.org/1999/xhtml'>"); line, this function is is execute successfully. do one thing put debug point on 'myHtmlFile = myBuilder.ToString();' and see what is stored in "myHtmlFile". and check its syntax. and if it is modified before final output than check it after every modification. I hope U will Get ride on ur problem. all the best

1 solution

In simple terms, you're using some type of AJAX mechanism which is expecting its result to be in one format (I suspect JSON), and you're sending it in another.

You shouldn't be returning a complete document (i.e. with <html> tags, DTD reference and so on) if the intent is to push this into an existing page, anyway. You should have a method which wraps the table as HTML, but only the <table> (or surrounding <div>) tag section.

Then you can use standard AJAX techniques (i.e. not whatever piece of Microsoft magic you're using write now) to retrieve the URL and replace the content of an existing item on the page with it.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900