Welcome Guest Search | Active Topics | Sign In | Register

How to force a callback to terminate Options
Phil Morris
Posted: Wednesday, September 30, 2009 7:48:49 PM
Rank: Advanced Member
Groups: Member

Joined: 6/5/2007
Posts: 35
I have pages that use callback panels. The code behind includes checks for errors; when an error occurs, the code behind invokes a utlity method to bring up an error page to display the error information. However, unlike page.Response.Redirect("errorpage.aspx"), callbackpanel.Redirect("errorpage.aspx") does not force immediate termination of current processing. Code following the callbackpanel.Redirect() gets executed, which may or may not cause a problem (it often does!)

I guess I could throw an exception and catch that somehwere but that seems a pretty crude approach. Is there a way of forcing an immediate terminaton of a callback? If not, would you add that capability in?

Thanks
eo_support
Posted: Wednesday, September 30, 2009 8:21:48 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

The page will continue to complete its life cycle regardless you throw out an exception or not. So the cleanest way is to use if statement to skip code that you do not want to execute. This is not something we can add on the control because a control can not change the page's execution flow.

Thanks


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.