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.....

7 comments: