简体   繁体   中英

Response.Redirect cannot be called in a Page callback

I am getting this error. I am using ICallbackEventHandler to fill the some dropdowns. On a particular condition I want to redirect to a certain aspc page but I am getting

Response.Redirect cannot be called in a Page callback.

I have also used Server.Transfer but problem did not solve.

Response.Redirect() implicate call the Response.End() which would absolutely stop the page-lifecycle execution.

So you cannt use it in your callback method. You can use a client method instead it like window.location.href = "...."

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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