title: How to use CkEditor binded with Razor-Model
body: <p>In my Razor, I am using a model-binded textarea as : </p>
  
  <pre><code>@Html.TextAreaFor(model =&gt; model.myHtml, new { @class = "form-control" })
  </code></pre>
  
  <p>I am also replacing the Textarea with CKEditor as: </p>
  
  <pre><code>CKEDITOR.replace('myHtml');
  </code></pre>
  
  <p>Now, during the postback to controller action, "myHtml" always shows as null.</p>
  
  <pre><code>[HttpPost]
  [ValidateAntiForgeryToken()]
          [ValidateInput(false)]
          public void PostModal(myModel modle)
          {// here modle.myHtml is always null.
  }
  </code></pre>
  
  <p>My Model is defined as:</p>
  
  <pre><code> public class myModel
      {
          public string myHtml { get; set; }
      }
  </code></pre>
  
  <p>I have tried below workarounds:</p>
  
  <p>1) Removed CKEditor, tried to bind the textarea with model and it WORKED FINE. I was able to get value in the controller post method.
  2) Tried to use  [ValidateInput(false)] - NO GO
  3) Tried to decorate the model property with  [DataType(DataType.Html)] - NOGO
  4) CKEDITOR.instances.myHtml.getData() shows correct value on button click, which means its an issue with the model binding.</p>
  
  <p>Any pointer would be appreciated.</p>
  
  <p>-Shalabh</p>