title: MVC Razor Form submit not working
body: <p>I am trying to use a simple form to allow authorized users to modify content on select pages on an MVC3 Razor site that I'm building.  I am unable to get the edit form to post correctly though.</p>
  
  <p>My model is as follows:</p>
  
  <pre><code>public class WebContent
  {
      public virtual UInt32 id { get; set; }
      public virtual String page { get; set; }
      public virtual String section { get; set; }
  
      [UIHint("tinymce_jquery_full"), AllowHtml]
      public virtual String content { get; set; }
  }
  </code></pre>
  
  <p>My Controller:</p>
  
  <pre><code>    [Authorize]
      public ActionResult Edit(String page, String section)
      {
          WebContent content = _WebContent.GetSection(page,section);
          return View(content);
      }
  
      [Authorize]
      [HttpPost]
      public ActionResult Edit(WebContent content)
      {
          if (ModelState.IsValid)
          {
              _WebContent.Update(content);
              return View("Index");
          }
          else return View("Index");
      }
  </code></pre>
  
  <p>And my View:</p>
  
  <pre><code>@model SongbirdsStudios.Models.WebContent
  @{
    ViewBag.Title = "Edit '"+Model.page+"'Page Content";
  }
  
  &lt;div&gt;
  &lt;h2&gt;Edit&lt;/h2&gt;
  @using (Html.BeginForm())
  {
  
      &lt;fieldset&gt;
          &lt;legend&gt;Page Content&lt;/legend&gt;
          @Html.HiddenFor(m =&gt; m.id)
          @Html.HiddenFor(m =&gt; m.page)
          @Html.HiddenFor(m =&gt; m.section)
          &lt;div class="editor-label"&gt;
              Content
          &lt;/div&gt;
          &lt;div class="editor-field"&gt;
              @Html.EditorFor(m =&gt; m.content)
          &lt;/div&gt;
          &lt;p&gt;
              &lt;input type="submit" value="Update" /&gt;
          &lt;/p&gt;
      &lt;/fieldset&gt;
  }
  &lt;/div&gt;
  </code></pre>
  
  <p>The view renders correctly and displays the expected elements.  The UIHint("tinymce_jquery_full") is getting picked up correctly and the TinyMCE editor appears on the page.  But, when the form submits, I get an exception.</p>
  
  <pre><code>System.Web.HttpRequestValidationException: A potentially dangerous Request.Form value was detected from the client (content=...)
  </code></pre>
  
  <p>Everything I've read indicates that the AllowHTML attribute should allow this to post, but it's not for some reason.</p>
  
  <p>I can get around this by adding the [ValidateInput(false)] attribute to the HttpPost controller method. If I do that, then this exception does not occur, but the model still does not get passed to the controller.  It just passes null instead.  Examining the HttpContext in the debugger indicates that it is passing 4 separate values - one for each property in my model instead of passing the model class back to the controller.  I can't figure out what I need to change to make this work correctly.</p>
  
  <p>I'm hoping it's something simple that I missed, and someone with a better eye can see what it is.</p>