title: Can i upload file in jquery dialog in asp.net mvc
body: <p>I have a form in which user inputs its data along with its image. This form will be in a jquery dialog. I want to know if its is possible that if I upload an image and then send it to server for saving on hard drive after that without loosing that dialog print a message your file uploaded. If yes then how i can use jquery ajaxform <a href="http://jquery.malsup.com/form/#ajaxForm" rel="nofollow">plugin</a>. Im using asp.net mvc.</p>
  
  <p>What i have tried is as follows</p>
  
  <p><strong>My View</strong> </p>
  
  <pre><code>&lt;div id="dialog" title="Dialog Title" style="display: none"&gt;
          &lt;div id="Jobs"&gt;
          &lt;form id="frmupload" enctype="multipart/form-data" method="post"&gt;
              &lt;input id="File1" type="file" name="file" /&gt;
              &lt;input id="Button1" type="submit" value="Upload" name="button" /&gt; 
              &lt;/form&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p><strong>My JQuery</strong></p>
  
  <pre><code>function dialogs(id) {
          $(function () {
              var ph = $("#Jobs");           
                  ph.dialog({
                      width: 700,
                      modal: true,
                      show: 'slide',
                      closeText: 'hide',
                      draggable: false,
                      resizable: false
                  });
              //});
          });
      }
  
      function clik(id) {
          dialogs(id);
          return false;
      }
   var options = {
              url: "/Post/UploadImages"            
          };       
  
          $('#frmupload').ajaxForm(function (options) {
              //alert(data);
              alert("Thank you for your comment!");
          });
  </code></pre>