title: How do I post a javascript variable to an ASP.net MVC Model?
body: <p>Im trying to use the Yahoo rich text editor in my web application. I'm kind of new to web programming so this may be a silly question. </p>
  
  <p>I'm using a custom model called "blogpost". It contains the following properties:</p>
  
  <p>Title
  Body
  DateCreated
  Author</p>
  
  <p>I want to use the custom editor for only the "body" property. When I click submit it will build the other properties of the model from simple textboxes. I have placed the following code withing my input form code.</p>
  
  <pre><code>&lt;div class="yui-skin-sam"&gt;
          &lt;textarea name= "msgpost" id="msgpost" cols="50" rows="10"&gt;
          &lt;/textarea&gt;
          &lt;script&gt;
  
              var myEditor = new YAHOO.widget.Editor('msgpost', {
              height: '300px',
              width: '522px',
              dompath: true, //Turns on the bar at the bottom
              animate: true //Animates the opening, closing and moving of Editor windows
              });
  
              myEditor.render();
  
              YAHOO.util.Event.on('Create', 'click', function () {
                  myEditor.saveHTML();
                  var body = myEditor.get('element').value;
  
              });                              
          &lt;/script&gt;
          @ViewData.Add("Body",//how do I add the javascript variable "body" ?)
  
  
  &lt;/div&gt;
  </code></pre>
  
  <p>How do I "post" the javascript variable "body" so the MVC model builder recognizes it?</p>