blog

Home / DeveloperSection / Blogs / Encode - Decode in ASP.NET

Encode - Decode in ASP.NET

Uttam Misra4842 22-Dec-2010

Html Encode method encodes a particular string to be displayed in a browser. It is important to encode strings prior it’s rendering in the page, mainly to avoid cross-site script injection (XSS) and HTML injection attacks. However, developers so often forget to call the encode function.

Html Decode method decodes a particular string which is encoded.

Encoding and decoding is needed in somewhere like

·         Pass the values from one page to another.

·         Access the URL or pass the URL.

·         Fetch the data or insert data in Database.

·         Read the xml data or insert data in xml.

·         Change the special character from string

·         And security purpose etc. 

In ASP.Net we used the following encode and decode method:

·         Server.HtmlEncode()

·         Server.HtmlDecode()

·         Server.HtmlUrlEncode()

·         Server.HtmlUrlDecode ()

·         HttpUtility.UrlEncode()

·         HttpUtility.UrlDecode ()

 

Check details here:

http://www.mindstick.com/Articles/b3d1fb4c-f386-49af-a464-fc96467eb957/?Encoding%20and%20Decoding%20in%20ASP%20Net

 

 


Updated 18-Sep-2014
More than 18 years of working experience in IT sector. We are here to serve you best.

Leave Comment

Comments

Liked By