Microsoft JScript runtime 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. Ajax Toolkit – Update Panel and Datagrid download button
So I have a datagrid which is a listing of files in a network share. I have a linkbutton in the grid with its text property set to a filename. This datagrid sits inside an UpdatePanel so it is all ‘Ajaxified’. When testing the command on the link button I received the following error.
Microsoft JScript runtime 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.
Now I do understand why I received this error, I had modified the output stream back to the client via AddHeader methods etc but I need to in order to get this file back to client!
Well fortunately there is a way to tell the Ajax parser code on the client that content coming back was modified on the server side via script manager and also by registering the datagrid as a postback control.
ScriptManager _scriptManager = ScriptManager.GetCurrent(this.Page); _scriptManager.RegisterPostBackControl(myDataGridID);
Hope this helps!!
hi i tried to keep that code of registerscript in rowcommand of gridview but it gives the same error. could you please suggest me how top solve this ajax error.
Thanks in advance
shaik
June 9, 2011 at 8:16 am