Click here to Skip to main content
15,921,113 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi everybody!
I am using RadAjaxPanel on my page, on the click of a button (cod behind) I use Response.Redirect but the redirect is not working. I am getting the following error:
Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed.

Please help!

Thanks in advance.
Posted
Updated 13-Apr-11 11:14am
v2
Comments
Manfred Rudolf Bihy 14-Apr-11 10:27am    
Ping! Any news on your progress?

1 solution

Your problem is that a Response.Redirect sends a response back to your client (browser) and since the corresponding request was made by an AJAX panel the javascript code of your AJAX control needs to parse the servers response. A Response.Redirect sends a response that would normally make the browser navigate to a different page, but since it's an AJAX control the response is meaning less to your RadAjaxPanel.
You can solve this by using Server.Transfer to make a "redirect" on the server side. This means that the flow of control is passed from on page to another (maybe also the same page with rewritten parameters) without the browser needed for interaction.

Read some about it here: http://techahead.wordpress.com/2007/10/14/aspnet-servertransfer-vs-responseredirect/[^].

If you still have questions come back and leave a comment! (But please google for Server.Transfer first!)

Happy coding!

-MRB
 
Share this answer
 
v2
Comments
Rohit.Net100 13-Apr-11 18:15pm    
I am getting below error when using server.transfer---
Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: Invalid path for child request 'http://defaultwebsite.aspx'. A virtual path is expected.
Manfred Rudolf Bihy 13-Apr-11 18:35pm    
Please modify your question with the relevant source code especially the exact path that you call Server.Transfer with and drop a comment to this solution so I'll get notified when you're done with the editing of your question.
Rohit.Net100 13-Apr-11 18:41pm    
I am using path to my reports server, actually on my button click where i am doing redirect/transfer, it genegates pdf reports.
Manfred Rudolf Bihy 13-Apr-11 18:52pm    
Please read my reply to your comment above and do what I requested. If you tried calling another website however that is not identical to the one running your application (virtual directory) then you're out of luck with using Server.Transfer. The only way to go then is to make the call to that website/webserver using HttpWebRequest, receive the result and pass that back to the client.
Rohit.Net100 14-Apr-11 10:34am    
I put my button which cause redirect outside AjaxPanel.
Now works fine.
Thanks for help.

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