title: Html.BeginForm wont call post method
body: <p>I try to insert image to server, in view i use mvc2, my code is:</p>
  
  <pre><code>&lt;% using (Html.BeginForm("Upload", "Main", FormMethod.Post, new { enctype = "multipart/form-data" }))
  {%&gt;&lt;br /&gt;
     &lt;input type="file" name="files" id="file1" size="25" /&gt;
     &lt;input type="submit" value="Upload file" /&gt;      
  &lt;% } %&gt;  
  </code></pre>
  
  <p>In MainController I use:</p>
  
  <pre><code>[HttpPost]
      public ActionResult Upload()
      {
          foreach (string inputTagName in Request.Files)
          {
              HttpPostedFileBase file = Request.Files[inputTagName];
              if (file.ContentLength &gt; 0)
              {
                  string filePath = Path.Combine(HttpContext.Server.MapPath("../Images")
                          , Path.GetFileName(file.FileName));
                  file.SaveAs(filePath);
              }
          }
       }
  </code></pre>
  
  <p>But when i go on <code>submit</code> button nothing happen i try to debug and I see that <code>public ActionResult Upload</code> are not calling.
  What can be problem?</p>
  
  <p>Thanx</p>