Redirecting on a callback

11 בפברואר 2009

אין תגובות

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.

הוסף תגובה
facebook linkedin twitter email

כתיבת תגובה

האימייל לא יוצג באתר. שדות החובה מסומנים *