title: ASP.NET AJAX Control toolkit file upload
body: <p>I'm having some difficulty implementing the ajax control toolkit file upload. This is what i have coming up and the following is my code. I'm sorry for using VB, i was forced. If you know a C# solution please provide it and i will convert the code. Thank you</p>
  
  <p><img src="https://imgur.com/jtmPmYW.jpg" alt="a busy cat"></p>
  
  <pre><code>&lt;%@ Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm2.aspx.vb" Inherits="AMS.WebForm2" %&gt;
  
  &lt;%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %&gt;
  
  &lt;!DOCTYPE html&gt;
  
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head runat="server"&gt;
  &lt;title&gt;&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  &lt;form id="form1" runat="server"&gt;
      &lt;asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" /&gt;
  
      &lt;asp:AjaxFileUpload ID="AjaxFileUpload1" runat="server" /&gt;
      &lt;asp:Image ID="loader" runat="server"
          ImageUrl="~/loading.gif" Style="display: None" /&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Code behind</p>
  
  <pre><code>Imports System.Web.Script.Serialization
  Imports AjaxControlToolkit
  
  Public Class WebForm2
  Inherits System.Web.UI.Page
  
  Protected Sub UploadComplete(sender As Object, e As AjaxControlToolkit.AjaxFileUploadEventArgs)
      Dim path As String = Server.MapPath("Files/") + e.FileName
      AjaxFileUpload1.SaveAs(path)
  End Sub
  End Class
  </code></pre>