Documentation for: ASP.NET Ajax Version 1.0

This documentation is for a previous version. For the current released version, see the ASP.NET Ajax documentation on MSDN.

 

 

 

 

 

 

 

Sys.Net.WebServiceError.statusCode Property

Gets the underlying HTTP error status code for the Web request.

Syntax

var statusCode = error.get_statusCode();

Return Value

The HTTP error status code for the response.

Remarks

Use this property to identify error conditions in an HTTP response. For a list of possible HTTP status code values, see HTTP Status Codes on the MSDN Web site.

You can use the Sys.Net.WebServiceError.statusCode property to customize the handling of specific HTTP errors. For example, a Web service might fail because it requires URL authorization. In that case, you would look for a 401 (unauthorized) status code, and you could then inform the user that a logon is required.

For an example, see the Sys.Net.WebServiceError class overview.