title: set html content to TinyMCE editor content in ASP.NET MVC
body: <p>I have following controller method </p>
  
  <pre><code>    public ActionResult tinymce_editor()
      {
          return View();
      }
  </code></pre>
  
  <p>Then I want to load some html content to TinyMCE editor content</p>
  
  <p>this is the html content I want to load </p>
  
  <pre><code>&lt;div&gt;
     &lt;img src='http://localhost/Content/sam.jpg' /&gt;
         &lt;div&gt;Image Title&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>According to the documentation I followed this <a href="http://www.tinymce.com/wiki.php/api4%3Amethod.tinymce.Editor.setContent" rel="nofollow"> setContent</a> method</p>
  
  <p>And tried to set content using like this </p>
  
  <p><strong>Approach 1</strong></p>
  
  <pre><code>@{
      Layout = null;
  }
  
  &lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;script type="text/javascript" src="~/Scripts/tinymce/tinymce.min.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript"&gt;
  tinymce.init({
      selector: "textarea",
      theme: "modern",
      plugins: [
          "advlist autolink lists link image charmap print preview hr anchor pagebreak",
          "searchreplace wordcount visualblocks visualchars code fullscreen",
          "insertdatetime media nonbreaking save table contextmenu directionality",
          "emoticons template paste textcolor colorpicker textpattern imagetools",
          "advlist autolink lists link image charmap print preview anchor",
          "searchreplace visualblocks code fullscreen",
          "insertdatetime media table contextmenu paste imagetools"
      ],
      toolbar1: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image",
      toolbar2: "print preview media | forecolor backcolor emoticons",
  
      image_advtab: true,
      templates: [
          {title: 'Test template 1', content: 'Test 1'},
          {title: 'Test template 2', content: 'Test 2'}
      ]
  });
  
  var data = "&lt;div&gt;&lt;img src='http://localhost/Content/sam.jpg' /&gt;&lt;div&gt;Image Title&lt;/div&gt;&lt;/div&gt; html";
   tinyMCE.activeEditor.setContent(data, { format: 'raw' });
  
      &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;h1&gt;TinyMCE Getting Started Guide&lt;/h1&gt;
      &lt;form method="post" action="somepage"&gt;
          &lt;textarea name="content" style="width:100%"&gt;&lt;/textarea&gt;
      &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>and then like this </p>
  
  <p>(insert the html content to a html file then load <strong><em>myhtml.html</em></strong> file using jquery)</p>
  
  <p><strong>Approach 2</strong></p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
      &lt;script type="text/javascript" src="~/Scripts/tinymce/tinymce.min.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript"&gt;
  tinymce.init({
      selector: "textarea",
      theme: "modern",
      plugins: [
          "advlist autolink lists link image charmap print preview hr anchor pagebreak",
          "searchreplace wordcount visualblocks visualchars code fullscreen",
          "insertdatetime media nonbreaking save table contextmenu directionality",
          "emoticons template paste textcolor colorpicker textpattern imagetools"        
      ],
      toolbar1: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image",
      toolbar2: "print preview media | forecolor backcolor emoticons",
  
      image_advtab: true,
      templates: [
          {title: 'Test template 1', content: 'Test 1'},
          {title: 'Test template 2', content: 'Test 2'}
      ]
  });
  
  $.get("myhtml.html", function (content) {
      // if you have one tinyMCE box on the page:
      tinyMCE.activeEditor.setContent(content);
  });
  
      &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;h1&gt;TinyMCE Getting Started Guide&lt;/h1&gt;
      &lt;form method="post" action="somepage"&gt;
          &lt;textarea name="content" style="width:100%"&gt;&lt;/textarea&gt;
      &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>but none of above approach not working , what should I do to correct this </p>