Click to Rate and Give Feedback
MSDN
MSDN Library
Web Development
Server Object (IIS)
 Server.URLEncode Method

  Switch on low bandwidth view
Server.URLEncode Method

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

© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker