title: Upload a file in MVC without form tags
body: <p>I have a colorbox pop-up where I am displaying my view - UploadDocument. In this view I am having file upload element (type="file" ) and a textbox.</p>
  
  <p>Here is the code for colorbox- </p>
  
  <pre><code> parent.parent.$.fn.colorbox({
                              href: url +  '?callingWindow=' + window.frameElement.id,
                              open: true,
                              iframe: true,
                              width: "450px",
                              height: "300px",
                              title: "Upload Document",
                              close: '&lt;button id=\"Save\"&gt;Save&lt;/button&gt;&lt;button id=\"Cancel\"&gt;Cancel&lt;/button&gt;',
                              onClosed: false
                          }); 
  </code></pre>
  
  <p>UploadDocument view is - </p>
  
  <pre><code>&lt;h4 class="resume"&gt;Upload a document to presentation &lt;/h4&gt;
      &lt;div class="description"&gt;Please click on the link below to add documents to your presentation.&lt;/div&gt;
  
      &lt;table id="fieldsTable" class="tblFields"&gt;
      &lt;tr&gt;
      &lt;td class="description"&gt;Choose file:&lt;/td&gt;
          &lt;td&gt; &lt;input id="fileDialog" type="file" name="file"/&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
      &lt;td class="description"&gt;Description:&lt;/td&gt;
          &lt;td&gt; &lt;input type="text" id="docFileName" style="width: 225px;"/&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
      &lt;td colspan="2" width="300px"&gt;&lt;span class="errorMessage" id="spanErrorMessage"&gt;&lt;/span&gt;&lt;/td&gt;
      &lt;/tr&gt;
     &lt;/table&gt;
  </code></pre>
  
  <p>On my view I am calling Post method of controller action on Save button's click.</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  parent.$('#Save').click(function() {
               $.ajax({
                      url: '@Url.Action("UploadDocument", "MyController")',
                      type: 'POST',
                      dataType: 'json',
                      cache: false,
                      data: { id: cmaId},
                      success: function () {
                          alert('added to temp');
                      }
                  });
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>Now when I call the action method UploadDocument with HttpPostedFileBase as a parameter. It is null all the time.</p>
  
  <p>Is it because for this to work we have to have a  tag and type=submit ? 
  Since I can not do it here as Save button is not part of the view, but it's parent, is there any alternative for doing this with a normal button click and without any form tags ?</p>