c# 2.0 - Apply Html style in grid cell content -


i want format c# code in grid cell. want apply italic style string strprojectdelivery. not happening.

the below csharp string.

strprojectresults = strprojectgoals + "" + strprojectdelivery 

i used server.htmlencode().

strprojectresults = strprojectgoals + server.htmlencode("<i>"+ strprojectdelivery+"</i>"); 

and string result this,

highprioritygoals&lt;i&gt;deliveredontime&lt;/i&gt; 

even htmldecode not working. please let me know how handle this.

thanks in advance.

the purpose of html encoding take arbitrary text , escape html tags it's treated plain text.

html-escaping <i> defeats purpose.

instead, need html-escape content you're building html

you need know whether each variable treated html or text, or you'll end having xss holes.


Comments

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -

c# - String.format() DateTime With Arabic culture -