Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

AsyncFIleUpload's OnUploadComplete not firing

$
0
0

Hello!

I've been trying to use the AsyncFileUpload on my Master Page since yesterday, but for some reason, the OnUploadComplete event just doesn't fire (I've checked it with the debugger already, and the method is not called).

However, for some unknown reason, it only fires under certain conditions fires when the upload is done though one of the pages that use this Master Page, but it doesn't fire in any other page.

Here's some information...

I'm using two Master Pages: "Geral.master", "Site.master"(which contains the AsyncFileUpload and uses "Geral.master" as its master page).

Most of the pages uses "Site.master" as the Master Page, since I need the upload function in most of the parts of my website.

Here's the code for Site.master:

<%@ Master Language="C#" MasterPageFile="~/Geral.master" AutoEventWireup="true" CodeFile="Site.master.cs"
    Inherits="SiteMaster" %><%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %><asp:Content ID="Head" ContentPlaceHolderID="HeadContent" runat="Server"><asp:ContentPlaceHolder ID="HeadContent" runat="server"></asp:ContentPlaceHolder></asp:Content><asp:Content ID="Main" ContentPlaceHolderID="MainContent" runat="Server"><table width="98%" border="0" cellpadding="0" cellspacing="0"><tr><td style="width: 80%"><asp:ContentPlaceHolder ID="MainContent" runat="server"></asp:ContentPlaceHolder></td><td style="width: 20%" class="RightCell"><asp:AsyncFileUpload ID="MusicAsyncFileUpload" runat="server"
                    ThrobberID="UploadImage" OnUploadedComplete="MusicAsyncFileUpload_UploadedComplete"
                    PersistFile="True" /><%--<p style="text-align: left">--%><asp:Image ID="UploadImage" runat="server" ImageUrl="~/image/uploading.gif" /><asp:Panel ID="UploadCompletePanel" runat="server"
                            ClientIDMode="Static"><p>
                                Upload complete! Click on the button below to give us some information about the
                                music:</p><asp:Button ID="UploadCompleteButton" runat="server" Text="Complete"
                                onclick="UploadCompleteButton_Click" /></asp:Panel><asp:UpdatePanel ID="FileUploadUpdatePanel" runat="server"><ContentTemplate><%--</p>--%></ContentTemplate></asp:UpdatePanel></td></tr></table></asp:Content>

The page that works correctly (Musics.aspx). For some weird reason, the OnUploadComplete server-side event is only fired when the GridView is filled! If there are no rows on the GridView (and the GridView's no data message is displayed instead of the rows), then the OnUploadComplete  event is not fired!

<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="Musics.aspx.cs" Inherits="Musics" %><asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server"></asp:Content><asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server"><p><%--This is the GridView that "solves" the issue when filled:--%><asp:GridView ID="MusicasGridView" runat="server" AllowPaging="True" 
        AutoGenerateColumns="False" DataKeyNames="id" 
        DataSourceID="MusicasSqlDataSource" EmptyDataText="No musics found"><Columns><asp:TemplateField HeaderText="Music" InsertVisible="False" SortExpression="id"><EditItemTemplate><asp:Label ID="Label1" runat="server" Text='<%# Eval("id") %>'></asp:Label></EditItemTemplate><ItemTemplate><asp:LinkButton ID="MusicLinkButton" runat="server" 
                        CommandArgument='<%# Eval("id") %>' oncommand="MusicLinkButton_Command" 
                        Text='<%# Eval("name") %>'></asp:LinkButton></ItemTemplate></asp:TemplateField><asp:BoundField DataField="artist" HeaderText="Artist" 
                SortExpression="artist" /></Columns></asp:GridView><asp:SqlDataSource ID="MusicasSqlDataSource" runat="server" 
        ConnectionString="<%$ ConnectionStrings:Musicon %>" 
        SelectCommand="SELECT id, name, artist, filename, tags FROM Music WHERE (name LIKE '%' + @search + '%') OR (tags LIKE '%' + @search + '%') ORDER BY name"><SelectParameters><asp:QueryStringParameter Name="search" QueryStringField="search" /></SelectParameters></asp:SqlDataSource></p></asp:Content>

 

Could this be a bug in the AsyncFileUpload control or is it something that I'm missing?

Thanks!!


Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>