I am trying to get this AjaxFileUpload (used in ContentPage). But it does not OnUploadComplete event on the server side
I am using version 4.1.60919.0 for ControlToolkit. I tried everything I found on the Internet.
Here are just a few steps:
- Added method enctype = "multipart / form-data" = "post" to the form element in my MasterPage
- Nested AjaxFileUpload in UpdatePanel with UpdateMode = Always
- Trial events UploadedComplete and OnUploadComplete, but remained on the second.
- Added try-catch block in EventHandler to detect unknown exceptions and print ExceptionMessage on a shortcut on the site -> nothing happened
- Tried with (out) ThrobberImage ...
- Many other hints that didn't work ...
So, I hope that we find a solution together in this community. Heres my markup:
<%@ Page Title="New Download" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="NewDownload.aspx.cs" Inherits="Internals_NewDownload" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="Server"> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="Server"> <ajax:ToolkitScriptManager ID="ToolkitscriptManager" runat="server"> </ajax:ToolkitScriptManager> <h1>Create a new Download</h1> <ajax:AjaxFileUpload ID="FileUpload" runat="server" ThrobberID="ThrobberLabel" OnUploadComplete="FileUpload_UploadComplete" /> <asp:Label ID="ThrobberLabel" runat="server" Style="display: none;"><img alt="UploadingPicture" title="Please wait while uploading..." src='<%= Constants.DomainString + "/Data/Images/loading-small.gif" %>' /></asp:Label> <asp:Label ID="DownloadLabel" runat="server"></asp:Label> </asp:Content>
And this is my CodeBehind:
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; public partial class Internals_NewDownload : System.Web.UI.Page { private string m_LanguageCode; protected void Page_Load(object sender, EventArgs e) { if (RouteData.Values.ContainsKey("LanguageCode")) m_LanguageCode = RouteData.Values["LanguageCode"].ToString();
Please, if you have ANY idea, feel free to let me know about it. I am very confused as I think what I just did in what I found on the Internet ...
Thanks in advance!
source share