title: AjaxfileUpload error
body: <p>I'm trying to implement a simple ajaxtoolkit fileupload control and every time I click "Upload" all I get is an error. I tried placing breakpoint in the "AjaxFileUpload1_UploadComplete" function but it won't even get fired.. (maybe because upload isn't complete yet?) what should I do to make it work?</p>
  
  <p>here is the error:
  <img src="https://i.stack.imgur.com/eBB4l.jpg" alt="enter image description here"></p>
  
  <p><strong>here is my aspx:</strong></p>
  
  <pre><code> &lt;form id="form1" runat="server"&gt;
      &lt;div&gt;
          &lt;asp:ScriptManager ID="ScriptManager1" runat="server"&gt;
          &lt;/asp:ScriptManager&gt;
  
         &lt;asp:AjaxFileUpload ID="AjaxFileUpload1" runat="server"
              onuploadcomplete="AjaxFileUpload1_UploadComplete" ThrobberID="myThrobber" MaximumNumberOfFiles="10" AllowedFileTypes="jpg,jpeg"/&gt;
  
      &lt;/div&gt;
      &lt;/form&gt;
  </code></pre>
  
  <p><strong>and here is the funcion behind:</strong></p>
  
  <pre><code>protected void AjaxFileUpload1_UploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e)
      {
          string id = "038191904";
          Directory.CreateDirectory(Server.MapPath("~/App_Data/" + id + "/scanned_docs/"));
          string filePath = "~/Member_Data/" + id + "/images/";
          string path = filePath + e.FileName;
          AjaxFileUpload1.SaveAs(Server.MapPath(filePath) + e.FileName);
  
          //db1.insert_pic_slide(id, path);
  
      }
  </code></pre>