We're attempting to make a redirect during a page callback. We have an aspx page that is implementing ICallbackEventHandler. Inside of the ICallbackEventHandler.RaiseCallbackEvent() event handler in the code-behind we're attempting to use the Response.RedirectLocation to move the user on to another aspx page. Our code is below.

void ICallbackEventHandler.RaiseCallbackEvent(string eventArgument)
{
    HttpContext.Current.Response.RedirectLocation = "http://www.google.com";
    HttpContext.Current.Response.End();
}

After raising the event client-side and setting breakpoints in the event handler we are sure that the code is being called but the page doesn't actually redirect. Are we missing something important here? We've tried several other ways including setting the Response.StatusCode and using Flush() instead of End(). Let me know if you need any additional information about what we're trying to do.

Any ideas would be greatly appreciated!

Thanks, Daniel

有帮助吗?

解决方案

The old fashioned way was Response.Redirect(url). Does that fix it?

其他提示

I did it without the last line and it works.

HttpContext.Current.Response.RedirectLocation = "http://www.google.com";

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top