Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

Server.URLEncode Method

IIS 6.0

The URLEncode method applies URL encoding rules, including escape characters, to a specified string.

URLEncode converts characters as follows:

  • Spaces ( ) are converted to plus signs (+).

  • Non-alphanumeric characters are escaped to their hexadecimal representation.

URLEncode(
   string
)

string

Specifies the string to encode.

This method has no return values.

The following script:


<%Response.Write(Server.URLEncode("http://www.microsoft.com")) %> 


produces the following output:


http%3A%2F%2Fwww%2Emicrosoft%2Ecom  


Applies To

Client: Requires Windows XP Professional, Windows 2000 Professional, or Windows NT Workstation 4.0.

Server: Requires Windows Server 2003, Windows 2000 Server, or Windows NT Server 4.0.

Product: IIS

Show:
© 2015 Microsoft