title: Send uploadify submit/post to aspx code behind method instead of handler and close jQuery modal form
body: <p>We're using Telerik's Sitefinity community edition and we've been having a <em>fun</em> time deploying handlers and webservices with it.  As such, I'm wondering if when using <a href="http://www.uploadify.com/" rel="nofollow noreferrer">Uploadify</a> instead of the script option heading to an ashx could we post it to a server side method that can take care of the uploading? If so, would someone please be very kind and post a quick and dirty example to get me started?</p>
  
  <p>This leads to another question. On this particular page, we're using the jQuery.FormWizard which doesn't play nice with server side forms. When it comes to uploading files, what we're trying to do is open up a modal form, have the user upload their files where upon completion, we'd simply close that modal form for them.  But that's not working and I'm pretty certain its because I'm not handling the OnComplete/OnAllComplete properly. Pointers on how to do this please?</p>
  
  <p>Here's the uploadify in the js file:</p>
  
  <pre><code>$("#VisaHelpNeeded").click(function() {
      //This opens the modal form
  
      $dialog.dialog('open');
  
      //********** Uploadify stuff here ********************
  
      $('#fileInput').uploadify({
          'uploader': '../../App_Themes/ApRegistration/images/uploadify.swf',
          'script': 'WebForm1.aspx/Register',
          'scriptData': { 'society': $('#nationalSociety').val(), 'participant': $('participantName').val() },
          'cancelImg': '../../App_Themes/ApRegistration/images/cancel.png',
          'auto': true,
          'multi': true,
          'fileDesc': 'Image Files',
          'fileExt': '*.jpg;*.png;*.gif;*.jpeg;*.bmp',
          'sizeLimit': 4000000,
          onAllComplete: function(){$('#dialog-form').dialog('close');}
      });
  });
  </code></pre>
  
  <p>Here's the modal form</p>
  
  <pre><code>var $dialog = $('&lt;div&gt;&lt;/div&gt;')
  .html('&lt;label&gt;Please attach a scanned copy of your passport&lt;/label&gt;&lt;input     id="fileInput" name="fileInput" type="file" /&gt;')
  .dialog({
    autoOpen: false,
    height: 350,
    width: 485,
    modal: true,
    buttons: {
        Cancel: function() {
            $(this).dialog('close');
        }
    }
   });
  </code></pre>
  
  <p>And here's the attempted signature of the method call for saving it on the code behind (I read somewhere while researching this that the method ought to be a static web method, but I can't find the link now, sorry)</p>
  
  <pre><code>[WebMethod(true)]
  public static void Register(HttpContext context)
  { 
      //do lots of cool code here 
  }
  </code></pre>
  
  <p>Many thanks/</p>