Freshers Aptitude technical questions
Freshers Job Alert
Bookmark and Share

  URLEncode & HRMLEncode

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

Syntax
Server.URLEncode( string )

Parameters

string

Specifies the string to encode.

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

produces the output
http%3A%2F%2Fwww%2Emicrosoft%2Ecom

 

The HTMLEncode method applies HTML encoding to a specified string.

Syntax
Server.HTMLEncode( string )

Parameters

string

Specifies the string to encode.

Example
The following script
<%= Server.HTMLEncode("The paragraph tag: <P>") %>

produces the output
The paragraph tag: &lt;P&gt;

Note    The preceding output will be displayed by a Web browser as
The paragraph tag: <P>