I want to set a html content to TinyMCE editor content in ASP.NET MVC
so I come come with a solution that convert that HTML file to string in server side and then call it using ajax in client side
this is C# controller method
[HttpGet]
public string TyneMice()
{
return System.IO.File.ReadAllText(@"C:\Users\..\myhtml.html");
}
this is ajax call ,
<script type="text/javascript">
tinymce.init({
...,
setup: function (ed) {
ed.on("init", function (ed) {
$.ajax({
type: "GET",
url: "Brochure/TyneMice",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (data) {
tinyMCE.activeEditor.setContent(data);
},
error: function () { alert("Ajax Error"); }
});
})
}
});
</script>
But Once I put debug point on above string method it is not invoking
Then I put above script inside $( document ).ready(function() { ... }
But the same result it doesnt work.