Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Server.URLEncode Method

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.



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:


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

© 2015 Microsoft