Forum Discussion
Gurpreet786
Nov 30, 2021Copper Contributor
exporting HTML saved in sql server to word in asp.net MVC application
I have a web application developed using ASP.NET MVC, C#, entity framework and SQL Server. I am using a rich editor to save HTML in SQL Server. I am able to render the saved html to webpage correctly using HTML.Raw
<p> @Html.Raw(item.TitleContent)</p>
But when I try to export this HTML retrieved using entity framework in my controller class to word document, the HTML formatting is getting messed up. Is there any HTML.Raw equivalent which I can use in my controller class?
Thanks.
1 Reply
- Eugene1990Copper Contributor
Gurpreet786 You may need to decode it, like this: HttpUtility.HtmlDecode(your content);