Printer Friendly Version      Send     
Click to Rate and Give Feedback
MSDN
MSDN Library
Web Development
Server Object (IIS)
 Server.URLEncode Method
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
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

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