Quantcast
Channel: AjaxControlToolkit Work Item Rss Feed
Viewing all articles
Browse latest Browse all 4356

Commented Unassigned: AsyncFileUpload.onclientuploadcomplete is firing when page is loaded. [27816]

$
0
0
I am trying to use the AsyncFileUpload inside of an UpdatePanel. Everything works, file uploads, server able to save it, events fire for server side.
But... the onclientuploadcomplete event which does fire when uploading is complete, is also firing when page loads. Of course this will cause an infinite loop if you do any forced postback when trying to update the UpdatePanel.

Ajax Control Toolkit v15.1
Visual studio 2010 v10.0.40291.1 SP1rel

=================================================================aspx
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Test.aspx.vb" Inherits="Test" %>

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>

<!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">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<cc1:AsyncFileUpload ID="AsyncFileUpload1" runat="server"
onclientuploadcomplete="alert('fired')" />
</ContentTemplate>
</asp:UpdatePanel>

</div>
</form>
</body>
</html>

Comments: To work around this issue, simply put your code into the function() block like this: OnClientUploadComplete="function() {alert('fired');}"

Viewing all articles
Browse latest Browse all 4356

Trending Articles