0

I have html in my data in MySql but when I retrieve the data in c# GridView it shows up. This does not happen when I pull the data in a classic asp page. How do I get rid of the HTML such as hyperlink and mailto markup but still retain the hyperlinks and mailto format in the asp.net c# web page. When I show the gridview all the markup is there instead of the actual hyperlink or mailto or even the paragraph formatting.

4
  • if you can possibly get rid of the html out of your real data that's what I would concentrate on. the alternative is using regular expressions and i would not want to go there... Commented Oct 11, 2018 at 3:04
  • Default behavior of ASP.NET is to HTML-encode anything you output to a web page. You have to explicitly tell it not to if you want the HTML actually rendered. Something like stackoverflow.com/questions/19445196/… Commented Oct 11, 2018 at 3:11
  • Show us a minimal code example Commented Oct 11, 2018 at 3:24
  • Thanks all for your comments Tieson T. helped to solve the issue and I can now use my HTML formatting in MYSQL and it renders correctly. Thanks all Commented Oct 15, 2018 at 13:48

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.