title: Image preview before upload using asp.net webpages & webmatrix + Jquery
body: <p>i've been trying to use a jquery &amp; ajax plugin for the image preview but i cant for the life of me get it to work. This is the site I found the code/demo</p>
  
  <p><a href="http://www.zurb.com/playground/ajax_upload" rel="nofollow">http://www.zurb.com/playground/ajax_upload</a></p>
  
  <p>I can get as far as changing the preview background but then no image is shown for the selected image file.</p>
  
  <p>this is my ,chtml file</p>
  
  <pre><code>&lt;!DOCTYPE html&gt; 
  &lt;html lang="en"&gt;
      &lt;head&gt; 
          &lt;meta charset="utf-8" /&gt;
          &lt;link href="@Href("~/Styles/jquery/jquery.ui.all.css")" rel="stylesheet" type="text/css" /&gt;
          &lt;link href="@Href("~/Styles/Site.css")" rel="stylesheet" type="text/css" /&gt;
          &lt;script src="@Href("~/Scripts/jquery-1.7.js")" type="text/javascript"&gt;&lt;/script&gt;
          &lt;script src="@Href("~/Scripts/jquery-ui-1.8.11.js")" type="text/javascript"&gt;&lt;/script&gt;
          &lt;script src="@Href("~/Scripts/jquery.js")" type="text/javascript"&gt;&lt;/script&gt;
          &lt;script src="@Href("~/Scripts/ajaxupload.js")" type="text/javascript"&gt;&lt;/script&gt;
  
          &lt;script&gt;     
          $(document).ready(function(){
          var thumb = $('img#thumb');     
          new AjaxUpload('imageUpload', {
              action: $('form#newHotnessForm').attr('action'),
              name: 'image',
              onSubmit: function(file, extension) {
                  $('div.preview').addClass('loading');
              alert(file);    
              },
              onComplete: function(file, response)
              {
                  thumb.load(function()
                  {
                     $('div.preview').removeClass('loading');
                      thumb.unbind();
                  });
                          thumb.attr('src', response);
                      }
                  });
              });
          &lt;/script&gt;       
      &lt;/head&gt; 
      &lt;body&gt; 
          &lt;h2&gt;New Hotness&lt;/h2&gt;
                      &lt;div&gt;
                                  &lt;div class="preview"&gt;
                                          &lt;img id="thumb" width="100px" height="100px" src="../Images/Test.jpg" /&gt;
                  &lt;/div&gt;
  
                                      &lt;form id="newHotnessForm"&gt;
                                                  &lt;label&gt;Upload a Picture of Yourself&lt;/label&gt;
                                                  &lt;input type="file" id="imageUpload" size="20" /&gt;
                                                  &lt;button type="submit" class="button"&gt;Save&lt;/button&gt;
                                          &lt;/form&gt;
  
                          &lt;/div&gt;
  
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>