Monday, 8 September 2014

how to remove Html tags from Gridview Cells programmatically with c#

how to remove Html tags from Gridview Cells programmatically with c#:


           When we access the data from SharePoint Lists to Gridview, normal columns data automatically  fetched as Normal Text... But When we access the MALTY-LINE  Column data, the data fetched with HTML-tags .  
           
with HtmlEncode true

   see the catagoryName column.. the data is fetched along with html tags. to remove the tags we have to change the value of HtmlEncode as false  
 the code is as follows :
 

With HtmlEncode False
<asp:boundfield datafield="Address" htmlencode="false" headertext="Address"/>
BY htmlencode=false we can overcome this problem. 
after this modification we get output as follow:

Thank you.....

9 comments:

  1. Thanks a lot for this apt answer, been looking for it since a day..thank you

    ReplyDelete
  2. 3B2D544476Josiah8C8E37DA921 January 2025 at 09:23

    20C94B27E0
    bot takipçi al

    ReplyDelete