I am using RadAsyncUpload control to upload the single file on button click. But when I hit the button, RadAsyncUpload.UploadedFiles.Count always says 0. Below is my code.
Thanks & Regards,
Sweta Chotalia
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="QuestionDesigner.aspx.cs"
MasterPageFile="~/Enigma/Masters/Main.master" Inherits="Enigma_QuestionDesigner"
EnableEventValidation="false" ValidateRequest="false" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<
asp:Content
ID
=
"Content1"
ContentPlaceHolderID
=
"MainContentPlaceHolder"
runat
=
"Server"
>
<
Scripts
>
<
asp:ScriptReference
Path
=
"~/Enigma/Telerik/Scripts/Common/Core.js"
/>
<
asp:ScriptReference
Path
=
"~/Enigma/Telerik/Scripts/Upload/RadProgressManager.js"
/>
<
asp:ScriptReference
Path
=
"~/Enigma/Telerik/Scripts/Common/jQuery.js"
/>
<
asp:ScriptReference
Path
=
"~/Enigma/Telerik/Scripts/Common/jQueryPlugins.js"
/>
<
asp:ScriptReference
Path
=
"~/Enigma/Telerik/Scripts/Upload/RadUpload.js"
/>
<
asp:ScriptReference
Path
=
"~/Enigma/Telerik/Scripts/AsyncUpload/RadAsyncUploadScripts.js"
/>
<
asp:ScriptReference
Path
=
"~/Enigma/Telerik/Scripts/Common/Popup/PopupScripts.js"
/>
<
asp:ScriptReference
Path
=
"~/Enigma/Telerik/Scripts/Upload/RadProgressArea.js"
/>
</
Scripts
>
</
asp:ScriptManager
>
<
asp:UpdatePanel
ID
=
"upQuestionSection"
runat
=
"server"
UpdateMode
=
"Conditional"
>
<
ContentTemplate
>
<
div
>
<
telerik:RadAsyncUpload
ID
=
"fileNodeDefinition"
runat
=
"server"
MaxFileInputsCount
=
"1"
AllowedFileExtensions
=
".xml"
MaxFileSize
=
"52428800"
>
</
telerik:RadAsyncUpload
>
</
div
>
</
ContentTemplate
>
</
asp:UpdatePanel
>
</
asp:Content
>
Below is Cs File Code
public void btnSave_Click(object sender,EventArgs e)
{
string filePath;
if (fileNodeDefinition.UploadedFiles.Count > 0)
{
string file = fileNodeDefinition.UploadedFiles[0].FileName;
filePath = HttpContext.Current.Server.MapPath(".\\Upload\\") + file;
fileNodeDefinition.UploadedFiles[0].SaveAs(filePath);
fileNodeDefinition.UploadedFiles.Clear();
fileNodeDefinition = null;
}
}
Thanks & Regards,
Sweta Chotalia