I am using C# ASP.NET MVC, and wish to populate a DIV with html stored in a database. I have tried the following:
//getting a string of HTML from a database
@{
string myHtml = Model.Data.Html;
}
//Using Javascript to insert this into a Div
<script>
$("#myDiv").html("@myHtml");
</script>
The div fills with the html, but it is inserted as raw text and displays all of the html tags. I have tried .append and .html to no avail.
Any help would be appreciated.