Wednesday, March 28, 2012

List of error code for args.get_response().get_statusCode()

I am getting error from ajax scripmanager 12031 when my session expires.

Now i need the List of all error codes and there description that we can get from args.get_response().get_statusCode()

I have used following code for tackiling my problem

<script language="javascript" type="text/javascript">
function load()
{
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
}

function EndRequestHandler(sender, args)
{
if (args.get_response().get_statusCode() == '12031' || args.get_response().get_statusCode() == '12030')
{
args.set_errorHandled(true);
window.location = "../Default.aspx?Error=PleaseLogin";
}

if ((args.get_response().get_statusCode() == '12007') || (args.get_response().get_statusCode() == '12029'))
{
alert('Please make sure you are connected to internet');
args.set_errorHandled(true);
}
}
</script>

<body onload="load()"> ...

hello.

i'm not following you...if it's an exception that hhapens on the server side you can always handle the asyncpostback error on the server side and get all the info about the exception...


Ok

But problem is that my session time out occur then this error come.

There are also some other error.

What i need is that if there is any list where i could get the details of these get_statusCode()


hello.

well, it really depends.

if the exception is an httpexception, the code is simply the httpcode of that exception. if i'm not mistaken, this exception will wrap unmanaged code errors. in that case, then you should check for the existing "windows" error codes. in fact, the number you mention belongs to the wininet error code range:

http://support.microsoft.com/kb/193625


Thanks Luis.IT really helped clearing what is hapening behind the scene

No comments:

Post a Comment