title: jquery Return to same screen without refreshing screen
body: <p>I have an upload view that needs to be used to upload three attachments. Now I used this code for the UI part in the view:</p>
  
  <pre><code>   &lt;div id="theDeliveryNoteContent"&gt;
       &lt;form action='Order/Save' method="post" enctype="multipart/form-data" id="deliveryNoteForm"&gt;
          &lt;div &gt;
              &lt;label style="text-align: left;"&gt;Delivery note:&lt;/label&gt;
              &lt;input type="file" name="DeliveryNoteFile" id="DeliveryNote" style="width: 400px;" /&gt;     
              &lt;div style="margin-top:4px;margin-bottom:4px"   &gt;      
                 &lt;input type="submit" value="Upload" id="btnAddAttachment" /&gt;
              &lt;/div&gt;
          &lt;/div&gt;               
      &lt;/form&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Now the method that I want to call is situated inside my Orders controller. Here is the method I'm using. The code works fine until the return part.</p>
  
  <pre><code>  [HttpPost]
      public ActionResult Save(HttpPostedFileBase DeliveryNoteFile)
      {
          try
          {
              string customer = GetCustomerLinkedToPortalUser();
              var uploadPath = "C:\\Attachments\\" + customer;
              if (!Directory.Exists(uploadPath))
              {
                  Directory.CreateDirectory(uploadPath);
              }
              if (DeliveryNoteFile != null)
              {
  
                  var fileName = Path.GetFileName(DeliveryNoteFile.FileName);
                  var physicalPath = Path.Combine(uploadPath, fileName);
                  DeliveryNoteFile.SaveAs(physicalPath);
              }
              return RedirectToAction("Index");
          }
          catch (Exception)
          {
  
              throw;
          }
  
      }
  </code></pre>
  
  <p>The problem is that when the method returns to the screen it refreshes the screen and all the entered information is lost. I want to save the file to that directory and come back to the order screen and upload the next file. Now how I'm supposed to do that I'm not sure so that is what I need help with.</p>
  
  <p>A colleague mentioned that I could use jQuery.Form script to do an ajax call so what I did is I added the jquery.form.js script to my project, did the referencing and I also added this to my javascript:</p>
  
  <pre><code>   $("#deliveryNoteForm").ajaxForm({
          target: "#theDeliveryNoteContent"
      });
  </code></pre>
  
  <p>So now it returns to my screen, but it messes up the layout and refreshes the screen (seems) anyway. Is there any other easy way to return to the previous screen with the method which I used without losing all the entered information?</p>