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 url Property

Gets or sets the URL of the Sys.Net.WebRequest instance.

Syntax

var requestUrl = MyWebRequest.get_url();
MyWebRequest.set_url(value);

Parameter

Description

value

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

Exceptions

Exception Type Condition

Sys.ArgumentNullException

value cannot be null.

Return Value

The URL that the Web request is directed to. If the URL has not been previously set, returns an empty string ("").

Remarks

You can set the URL to a fully qualified URL, an absolute URL, or a relative URL. The WebRequest class makes sure that the value that you set is converted into a form that the network executor can use.

Example

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

javascript

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