I am binding the Data to the GridView Control and When i click the Linkbutton in the GridView Control i am getting Exception:
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.
It's hard to tell why according to your description. There are many other possible causes besides Response.Write.
The general idea is that the response should conform to certain format, for instance: "111|updatePanel|UpdatePanel1| .... ", otherwise, the ajax library won't be able to parse it. And an exception is thrown.
You may use Fiddler to view the view the traffic, and you will see what response is returned from the server with the help of it. Then, it'll be easier to find out the real cause.
This Error is coming because your Client side unable to Parse your Response.
Here is msdn Quote about this Error, "If the response to an asynchronous postback returns without an error but there is an error processing the response in the client, the Sys.WebForms.PageRequestManagerParserErrorException is raised."
http://msdn.microsoft.com/en-us/library/bb397466.aspx
It is not a good practice to use Response.Write from within an ASP.NET page in general. As UpdatePanels work by intercepting the page rendering process you are recieving the errors.
You can put the code to generate the data in an HTTPHandler or you can make the button a PostBackTrigger.
It is not a good practice to use Response.Write from within an ASP.NET page in general. As UpdatePanels work by intercepting the page rendering process you are recieving the errors.
You can put the code to generate the data in an HTTPHandler or you can make the button a PostBackTrigger.
But i don't know how to generate the data in an HTTPHandler
sureshtalla
Member
11 Points
82 Posts
LinkButton in GridView with Update Panel Not working
Dec 14, 2012 07:20 PM|LINK
I am binding the Data to the GridView Control and When i click the Linkbutton in the GridView Control i am getting Exception:
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.
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:GridView Id="gvDetails" runat="server">
<ItemTemplate>
<asp:LinkButton ID="LinkButton1" runat="server" CommandArgument='<%# Convert.ToString(DataBinder.Eval(Container.DataItem, "up_user")) %>'
OnCommand="LinkButton1_Click" Text='<%# Convert.ToString(DataBinder.Eval(Container.DataItem, "name")) %>'> </asp:LinkButton>
</ItemTemplate>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
protected void LinkButton1_Click(Object sender, CommandEventArgs e)
{
if (e.CommandArgument != null)
{
Response.Redirect("http://google.com");
}
}
Please Help Me.
Thanks,
Nakor
Member
336 Points
60 Posts
Re: LinkButton in GridView with Update Panel Not working
Dec 15, 2012 04:31 AM|LINK
Can you try changing
to
<%# Eval("name") %>and
to
<%# Eval("up_user") %>Also, have you tried stepping through it with the debugger to see what it's doing and when the error occurs?
chetan.sarod...
All-Star
65839 Points
11163 Posts
Re: LinkButton in GridView with Update Panel Not working
Dec 17, 2012 02:17 AM|LINK
Hi,
It's hard to tell why according to your description. There are many other possible causes besides Response.Write.
The general idea is that the response should conform to certain format, for instance: "111|updatePanel|UpdatePanel1| .... ", otherwise, the ajax library won't be able to parse it. And an exception is thrown.
You may use Fiddler to view the view the traffic, and you will see what response is returned from the server with the help of it. Then, it'll be easier to find out the real cause.
This Error is coming because your Client side unable to Parse your Response.
Here is msdn Quote about this Error,
"If the response to an asynchronous postback returns without an error but there is an error processing the response in the client, the Sys.WebForms.PageRequestManagerParserErrorException is raised."
http://msdn.microsoft.com/en-us/library/bb397466.aspx
Possible Solution Here By, Eilon,
http://weblogs.asp.net/leftslipper/archive/2007/02/26/sys-webforms-pagerequestmanagerparsererrorexception-what-it-is-and-how-to-avoid-it.aspx
http://forums.asp.net/t/1038252.aspx
Senior Software Engineer,
Approva Systems Pvt Ltd, Pune, India.
RameshRajend...
Star
7983 Points
2099 Posts
Re: LinkButton in GridView with Update Panel Not working
Dec 17, 2012 02:55 AM|LINK
Find LinkButton on
and register it as agraciax8
Participant
751 Points
210 Posts
Re: LinkButton in GridView with Update Panel Not working
Dec 18, 2012 06:35 AM|LINK
Hi
It is not a good practice to use Response.Write from within an ASP.NET page in general. As UpdatePanels work by intercepting the page rendering process you are recieving the errors.
You can put the code to generate the data in an HTTPHandler or you can make the button a PostBackTrigger.
mycodepad.blogspot.com || TUMBLR
sureshtalla
Member
11 Points
82 Posts
Re: LinkButton in GridView with Update Panel Not working
Dec 20, 2012 09:05 AM|LINK
Thanks for your reply,
Hi
It is not a good practice to use Response.Write from within an ASP.NET page in general. As UpdatePanels work by intercepting the page rendering process you are recieving the errors.
You can put the code to generate the data in an HTTPHandler or you can make the button a PostBackTrigger.
But i don't know how to generate the data in an HTTPHandler
can you please help me,
Thanks,