无法在页面回调中调用响应重定向?

Rob*_*ert 5 asp.net ajax devexpress

当我暂停我的网络一段时间时,我收到以下错误

"Response.Redirect.can不能在Page回调中调用."

我在会话中存储用户ID,在页面加载期间我检查是否存在用户ID,然后我将它们重定向到登录页面.

我正在使用devexpress控件,如何让重定向工作?

小智 7

尝试使用Response.RedirectLocation属性,而不是在回调期间工作.

MSDN上的HttpResponse.RedirectLocation属性


小智 7

if(Page.IsCallback)ASPxWebControl.RedirectOnCallback("〜/ Login.aspx");

http://documentation.devexpress.com/#AspNet/DevExpressWebASPxClassesASPxWebControl_RedirectOnCallbacktopic


mat*_*net 1

您无法使重定向在回调中起作用。也许您可以在块中写入一些值<script type="text/javascript"/>并在客户端设置 window.location.href (重定向),而不是在服务器上执行 Response.Redirect ?