I am trying to populate a gridview from sharepoint list and population is working good expect in one column i want to display and <a>
tag
I have the following code:
StringBuilder cstext = new StringBuilder();
dr["Status"] = cstext.Append("<a>click me</a>");
but in my browser i am seeing this <a>click me</a>
and in inspect element i am seeing this <a>click me</a>
Please help me
cstext.Append("<a>click me</a>").toString();
? – Gautam Sheth Jul 11 '17 at 8:33ToString
won't help, as it's called anyway before rendering. The problem probably isHTMLEncode
-ing the content – Nils Jul 11 '17 at 8:36Append()
methods return value is intended for chaining (value.Append("a").Append("b")
). Using it in the way you are using it (like a regular System.String) is probably going to lead to other unwanted side effects. – StingyJack Jul 11 '17 at 12:15