Wednesday 18 November 2015

HTML encode

Dear All,


Forget old fashionable code like this  for create HTML Encode:

<asp:Label ID="LabelDescription" 
           runat="server" 
           Text='<%# System.Web.HttpUtility.HtmlEncode((string)Eval("Description")) %>' />



is as equal to :

<asp:Label ID="LabelDescription" 
           runat="server" 
           Text='<%#: Eval("Description") %>' />


with problem of NULL and other things.

Happy Coding

Thank You,
Manoj Kalla
Email ID: mr.manojbkalla@gmail.com
Website: manojbkalla.weebly.com 


No comments:

Post a Comment

Please, Write your valuable comments..