title: ViewModel is not binding from the POST form when passed into a method as a parameter
body: <p>I'm new to asp.net mvc, but I've thoroughly searched on this topic everywhere.</p>
  
  <p>I've a ViewModel class named PictureViewModel which is the class an EditorTemplate view inherits from:
      &lt;%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %></p>
  
  <pre><code>&lt;div class="editor-label"&gt;&lt;%: Html.LabelFor(m=&gt;m.Name) %&gt;&lt;/div&gt; 
  &lt;div class="editor-field"&gt;&lt;%: Html.TextBox("form.Name") %&gt;&lt;/div&gt; 
  
  &lt;div class="editor-label"&gt;&lt;%: Html.LabelFor(m=&gt;m.Description) %&gt;&lt;/div&gt; 
  &lt;div class="editor-field"&gt;&lt;%: Html.TextArea("form.Description") %&gt;&lt;/div&gt; 
  
  &lt;% Html.RenderAction("SelectCategory", "Category"); %&gt;
  
  &lt;div class="editor-label"&gt;&lt;label for="thumbFile"&gt;Thumb&lt;/label&gt;&lt;/div&gt; 
  &lt;div class="editor-field"&gt;&lt;input id="thumbFile" name="thumbFile" type="file"/&gt;&lt;/div&gt; 
  
  &lt;div class="editor-label"&gt;&lt;label for="fullFile"&gt;Full&lt;/label&gt;&lt;/div&gt; 
  &lt;div class="editor-field"&gt;&lt;input id="fullFile" name="fullFile" type="file"/&gt;&lt;/div&gt; 
  </code></pre>
  
  <p>Also I have file fields and all that is posted to itself</p>
  
  <pre><code>&lt;%@ Page Title="" Language="C#" MasterPageFile="/Views/Shared/Site_Table.Master"
   Inherits="System.Web.Mvc.ViewPage&lt;MvcApplicationVelarPolya.Areas.Admin.Models.PictureViewModel&gt;" %&gt;
  
  &lt;asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server"&gt;
      Create
  &lt;/asp:Content&gt;
  
  &lt;asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"&gt;
  
      &lt;h2&gt;Create&lt;/h2&gt;
  
      &lt;%
    using (Html.BeginForm("create", "Pictures", FormMethod.Post, new {enctype="multipart/form-data"})) 
     {%&gt; 
  
      &lt;%: Html.EditorForModel() %&gt;
  
      &lt;input type="submit" name="Create" /&gt;
  
  &lt;% }%&gt;
  
  &lt;/asp:Content&gt;
  </code></pre>
  
  <p>And here is the code devoted to handle the submit:</p>
  
  <pre><code>    [HttpPost]
      public ActionResult Create([Bind(Prefix="form")] PictureViewModel pm)
      {
          try
          {
              var p = new PictureViewModel();
              UpdateModel(p, "",new[] {"Name", "Description"});
              ViewData["name"] = Request.Files[0].FileName;
              return View("New", p);
          }
          catch
          {
              return View();
          }
      }
  </code></pre>
  
  <p>Neither adding prefixes, nor using FormCollection with UpdateModel doesn't help.
  I would greatly appreciate any help!
  Andrew.</p>
  
  <p>Oh, yes, viewdata is popuated with filename correctly!</p>
  
  <p>This is not working, too
          [HttpPost]
          public ActionResult Create(FormCollection fc/<em>[Bind(Prefix="form")] PictureViewModel pm</em>/)
          {
              try
              {
                  var p = new PictureViewModel();
                  UpdateModel(p, "form",new[] {"Name", "Description"});
                  ViewData["name"] = Request.Files[0].FileName;
                  // TODO: Add insert logic here
                  return View("New", p);
                  return RedirectToAction("Index");
              }
              catch
              {
                  return View();
              }
          }</p>
  
  <p>And this code</p>
  
  <pre><code>        foreach (var k in fc)
          {
              Debug.WriteLine(k.ToString());
          }
  </code></pre>
  
  <p>is producing</p>
  
  <pre><code>form.Name
  form.Description
  CategoryID
  Create
  </code></pre>