Is there anyway to use the AjaxFileUpload control inside an asp website. I know that it can be used in a web app, but cannot get it to work in my website.
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 ajaxfileupload : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void AjaxFileUpload1_UploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e)
{
string filePath = "~/upload/" + e.FileName;
AjaxFileUpload1.SaveAs(filePath);
}
}
tuckerjt07
0 Points
1 Post
AjaxFileUpload Control
Nov 19, 2012 09:46 PM|LINK
Is there anyway to use the AjaxFileUpload control inside an asp website. I know that it can be used in a web app, but cannot get it to work in my website.
CruzerB
Contributor
5399 Points
1098 Posts
Re: AjaxFileUpload Control
Dec 13, 2012 03:28 AM|LINK
Hi,
I think it will work. Please refer to below link.
http://msdn.microsoft.com/en-us/library/ff647506.aspx
My Technical Blog
chetan.sarod...
All-Star
65749 Points
11148 Posts
Re: AjaxFileUpload Control
Dec 14, 2012 02:36 AM|LINK
Refer this
http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/AjaxFileUpload/AjaxFileUpload.aspx
http://stephenwalther.com/archive/2012/05/01/ajax-control-toolkit-may-2012-release.aspx
Senior Software Engineer,
Approva Systems Pvt Ltd, Pune, India.
RameshRajend...
Star
7983 Points
2099 Posts
Re: AjaxFileUpload Control
Dec 14, 2012 02:53 AM|LINK
Please refer to the code as follow:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ajaxfileupload.aspx.cs" Inherits="ajaxfileupload" %> <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"> </asp:ToolkitScriptManager> <div> <asp:Label runat="server" ID="myThrobber" Style="display: none;"><img align="absmiddle" alt="" src="images/uploading.gif"/></asp:Label> <asp:AjaxFileUpload ID="AjaxFileUpload1" runat="server" onuploadcomplete="AjaxFileUpload1_UploadComplete" ThrobberID="myThrobber" MaximumNumberOfFiles="10" AllowedFileTypes="jpg,jpeg"/> </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 ajaxfileupload : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void AjaxFileUpload1_UploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e) { string filePath = "~/upload/" + e.FileName; AjaxFileUpload1.SaveAs(filePath); } }more ways
http://stephenwalther.com/blog/archive/2012/05/01/ajax-control-toolkit-may-2012-release.aspx
http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/AjaxFileUpload/AjaxFileUpload.aspx