title: MVC3 form posting with value and file
body: <p>I am new to MVC3 and I would like to create a form with input column and file upload.</p>
  
  <p>The problem comes when I try to do both thing at the same time.</p>
  
  <p>Here is my code</p>
  
  <pre><code>...
      [HttpPost]
      public ActionResult About(string inputStr)
      {
          string local = inputStr;
          string[] word = inputStr.Split(':');
          return View();
      }
      [HttpPost]
      public ActionResult GetFile(string inputStr, HttpPostedFileBase file)
      {
          string filename = file.FileName;
          return RedirectToAction("About");
      }
  </code></pre>
  
  <p>These two are my controllers</p>
  
  <pre><code>@using (Html.BeginForm("GetFile", "Home", (new { inputStr = "111" }), FormMethod.Post, new { enctype = "multipart/form-data" })){
  &lt;div class="editor"&gt;
  
    &lt;input type="file" name="file" /&gt;
    &lt;input type="submit" value="OK" id="submitFile" class="testingSubmit"/&gt;
  
  &lt;/div&gt;
  }
  </code></pre>
  
  <p>This code works well for uploading files, and sending string "111" to the controller.</p>
  
  <p>Here is another jQuery function</p>
  
  <pre><code>$('.testingSubmit').click(function () {
            var totalString="";
          $('.editor-field :input').each(function () {
              alert($(this).val());
              totalString += $(this).val().toString() + ":";
          });
  
          $('form').submit();
         /* $.post("About", { inputStr: totalString}, function (data) {
  
          });*/
      });
  </code></pre>
  
  <p>Here, what I am trying to do is the get the user input and put it on string totalString.
  I was able to post the totalString to the controller by using $.post</p>
  
  <p>My questions are:
  1. Am i on the right track? i.e. Is that possible to do those two tasks together with one post?
  2. If not, what are the possible solution for this?</p>
  
  <p>Thank you very much for your attention and hopefully this can be solved!</p>