DCSIMG
Redirecting on a callback - Itai Goldstein

Redirecting on a callback

In one of my previous posts, I reviewed a way to handle client side events on the server side by using the Callback feature of ASP.NET 2.0.

But what about redirecting from the current page when you handle the client event?

You’ll find that it is not possible: “Response.Redirect cannot be called in a Page callback.” or “Server.Transfer cannot be called in a Page callback.” messages will appear in case you’ll use Response.Redirect or Server.Transfer operations

In order to redirect to another page at the end of your flow, you’ll have to do it in the client side callback handler which was defined at the ClientScriptManager.GetCallbackEventReference method:

Redirecting on a callback 

Hope you’ll find it useful.
Published Wednesday, February 11, 2009 8:24 AM by itai

Comments

# Redirecting on a callback

You've been kicked (a good thing) - Trackback from DotNetKicks.com

Wednesday, February 11, 2009 9:12 AM by DotNetKicks.com

Leave a Comment

(required) 
(required) 
(optional)
(required) 

Enter the numbers above: