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.WebRequest.getResolvedUrl Method

Gets the resolved URL of the Sys.Net.WebRequest instance.

Syntax

var requestUrl = MyWebRequest.getResolvedUrl();

Parameter

Description

value

A string that represents the URL that the Web request is directed to.

Exceptions

Exception Type Condition

Sys.ArgumentNullException

value is null.

Return Value

The resolved URL that the Web request is directed to.

Remarks

This method returns the absolute URL representation, of the URL associated with the WebRequest instance. The URL includes the protocol identifier and the fully qualified domain name. This method is used by other classes such as network executors to determine the target URL for a Web request.

Example

The following example shows how to set and get the resolved URL for a WebRequest instance. This code is part of a complete example found in the WebRequest class overview.

javascript

// This function gets the resolved Url 
// of the Web request instance.
function GetWebRequestResolvedUrl()
{    
    // Instantiate the WebRequest.
    var wRequest =  new Sys.Net.WebRequest();

    // Set the request Url.  
    wRequest.set_url(getPage);  

    // Get the web request completed event handler.
    var resUrl = wRequest.getResolvedUrl();   
    alert("Resolved Url: " + resUrl);

    // Set the web request completed event handler,
    // for processing return data.
    wRequest.add_completed(OnWebRequestCompleted); 

    // Execute the request.
    wRequest.invoke();  
}