<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="vv" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <div> <vv:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"> </vv:ToolkitScriptManager> <vv:AjaxFileUpload id="ajaxUpload1" önUploadComplete="ajaxUpload1_OnUploadComplete" ThrobberID="MyThrobber" runat="server" /> <asp:Image id="MyThrobber" ImageUrl="~/Images/indicator3.gif" Style="display:None" runat="server" /> </div> </form> </body> </html>
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.IO; public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void ajaxUpload1_OnUploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e) { string filePath = "~/Uploads/" + e.FileName.ToString(); ajaxUpload1.SaveAs(MapPath(filePath)); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)