I am using Ajax in my application......
my code will execute properly in normalwebform....
My Code:
publicvoid ExportTOExcel(DataSet ds,HttpResponse res){
this.Response.Clear();this.Response.Charset ="";
this.Response.ContentType ="application/vnd.ms-excel";System.IO.StringWriter sw =new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter hs =newHtmlTextWriter(sw); DataGrid dg =newDataGrid();dg.DataSource = ds.Tables[0];
dg.DataBind();
dg.RenderControl(hs);
this.Response.Write(sw.ToString());this.Response.End();
}
when i execute the same code inajax webform it show me following error.....
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 '<table cellspacing="".
reply me ASAP........
Hi
I think the error message explain the issue clear.
You cann't modifiy response by calls to Response.Write(), response filters, HttpModules when you use AJAX. The message received from the server could not be parsed.
Then how to solve this problem do you any alternate solution for this error.........
send me any sample code...........
Please reply ASAP.
I'm experiencing the same issue. Found this article it will help you to understand some of the issues involved...http://mattberseth.com/blog/2007/07/indepth_the_updatepanel_aspnet.html
Mind you I haven't resolved the problem as yet, but it did take me one step closer.... so if any one find a solution please post.
No comments:
Post a Comment