简体   繁体   English

无法在页面回调中调用 Response.Redirect

[英]Response.Redirect cannot be called in a Page callback

I am getting this error.我收到此错误。 I am using ICallbackEventHandler to fill the some dropdowns.我正在使用 ICallbackEventHandler 来填充一些下拉菜单。 On a particular condition I want to redirect to a certain aspc page but I am getting在特定情况下,我想重定向到某个 aspc 页面,但我得到了

Response.Redirect cannot be called in a Page callback.无法在页面回调中调用 Response.Redirect。

I have also used Server.Transfer but problem did not solve.我也用过 Server.Transfer 但问题没有解决。

Response.Redirect() implicate call the Response.End() which would absolutely stop the page-lifecycle execution. Response.Redirect() 暗示调用Response.End()这将绝对停止页面生命周期的执行。

So you cannt use it in your callback method.所以你不能在你的回调方法中使用它。 You can use a client method instead it like window.location.href = "...."您可以改用客户端方法,例如window.location.href = "...."

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM