kashif, I was tracing the error in the event log and catching exceptions, that's why I choose to "clear" the error (check the other thread), because I "know' that this specific error would hurt the application:
I'd just like to remark that it only happens when you click over an image to trigger an async post back:
Here is the trace for one of them:
Event Type: Error
Event Source: ASP.NET 2.0.50727.0
Event Category: None
Event ID: 1078
Date: 10/11/2006
Time: 12:46:16
User: N/A
Computer: JUAN01
Description:
The state server has closed an expired TCP/IP connection. The IP address of the client is 127.0.0.1. The expired Read operation began at 11/10/2006 12:45:53.
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
And, here is the "cleaning" code:
Code behind:
Protected Sub ScriptManager1_AsyncPostBackError(ByVal sender As Object, ByVal e As Microsoft.Web.UI.AsyncPostBackErrorEventArgs) Handles ScriptManager1.AsyncPostBackError
If e.Exception.Message = "Input string was not in a correct format." Then
Server.ClearError()
Else
ScriptManager1.AsyncPostBackErrorMessage = e.Exception.Message
End If
End Sub
Page code:
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true"
ScriptMode="Release" />
<script type="text/javascript">
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
function EndRequestHandler(sender, args)
{
if (args.get_error() != undefined && args.get_error().httpStatusCode == '500')
{
var errorMessage = args.get_error().message;
args.set_errorHandled(true);
}
}
</script>
I hope this helps,
Juan