在Response.Redirect之后,RadAjaxPanel无法正常工作 [英] RadAjaxPanel is not working after a Response.Redirect

查看:85
本文介绍了在Response.Redirect之后,RadAjaxPanel无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!
我在页面上使用RadAjaxPanel,单击按钮(后面的代码)时,我使用Response.Redirect,但重定向不起作用.我收到以下错误:

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.

推荐答案

您的问题是Response.Redirect将响应发送回您的客户端(浏览器),并且由于相应的请求是由AJAX面板提出的您的AJAX控件的javascript代码需要解析服务器响应. Response.Redirect发送一个响应,该响应通常会使浏览器导航到其他页面,但是由于它是AJAX控件,因此响应对RadAjaxPanel的意义较小.
您可以通过使用Server.Transfer在服务器端进行重定向"来解决此问题.这意味着控制流从页面传递到另一个页面(可能是具有重写参数的同一页面),而无需浏览器进行交互.

在此处阅读有关此内容的信息: http://techahead.wordpress.com/2007/10 /14/aspnet-servertransfer-vs-responseredirect/ [
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


这篇关于在Response.Redirect之后,RadAjaxPanel无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆