Hello,
Has anyone had any luck using the AsyncFileUpload control from the Asp.net Ajax Control Toolkit within a DNN module?
I have it working in a plain asp.net project.
In DNN, it allows me to select a file, but when I click OK the javascript functions are not called. I've put some code below, cut from my more complex Edit.ascx control.
I removed teh line:
<ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager2" runat="server"></ajaxToolkit:ToolkitScriptManager>
As I got an error in the event log which say you can't register the control twice.
Can anyone please help me? If you need more information, please let me know.
Steve
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ContentItemUserControl.ascx.cs" Inherits="Netmonics.Modules.FlexiContent.ContentItemUserControl" %>
<%@ Register Src="~/desktopmodules/FlexiContent/UserControls/PageBehindUserControl.ascx" TagPrefix="uc1" TagName="PageBehindUserControl" %>
<%--<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>--%>
<script type="text/javascript">
//Determine the module id, set it as a url parameter, then upload the image.
function ClientUploadStarted(sender, args) {
alert("client upload started");
}
function uploadError(sender, args) {
alert("An error occurred during uploading. " + args.get_errorMessage());
}
function uploadComplete(sender, args) {
alert("upload complete");
}
function FileUploadComplete() {
alert("FileUploadComplete");
}
});
</Script>
<div id="ContentItemImage">
<%--<ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager2" runat="server"></ajaxToolkit:ToolkitScriptManager> --%>
<ajaxToolkit:AsyncFileUpload
OnClientUploadComplete="uploadComplete"
OnClientUploadError="uploadError"
OnUploadedComplete="FileUploadComplete"
OnClientUploadStarted="ClientUploadStarted"
runat="server"
ID="AsyncFileUpload1"
Width="500px"
CompleteBackColor="White"
UploadingBackColor="#ff0000"
ClientIDMode="Static"
ThrobberID="imgLoader"/>
<asp:Image ID="imgLoader" runat="server" ImageUrl="/DesktopModules/FlexiContent/images/top_icon_04.png"
<asp:Image ID="imgDisplay" style="height:200px;width:200px;" runat="server" ImageUrl="/"
</div>