Last post Jun 05, 2008 01:25 PM by mharris1984
Jun 05, 2008 11:06 AM|mharris1984|LINK
Is it possible to prematurely end a callback?
I am writing some central error handling code for my controls.
Whenever an error is detected, I want to immediately stop processing of the request and return a message via the callback.
The problem is, if you call Page.Response.End() the callback’s GetCallBackResult() method doesn’t get executed.
And therefore the callback is never returned to the client.
Jun 05, 2008 12:46 PM|anand_vijayan|LINK
The best way to stop execution is to throw a custom exception. For example the condition would look something like this
throw new CustomException("Error has occured");
In the page catch the custom exception and display a message
// Add logic to display the message
Jun 05, 2008 01:25 PM|mharris1984|LINK
Thanks but I dont think you fully understand my question.
Forget about the error handling. (adding the try / catch statement is the easy bit). My question is how do I get stop execution of the current request and jump straight to the GetCallbackResult() method.