Welcome Guest Search | Active Topics | Sign In | Register

AjaxUploader executed twice Options
Hub
Posted: Tuesday, January 22, 2013 1:00:35 PM
Rank: Advanced Member
Groups: Member

Joined: 3/16/2010
Posts: 101
Hello,

I have seen an old entry about this, but there was no resolution attached to it.
The problem I have is using the AjaxUploader with a toolbar startbutton. When I set a breakpoint on a statement in the "FileUploaded" method I see the statement is executed twice.

I have attached a simple page to reproduce the problem. I assume there is something wrong in the way I configure the control, but I cannot figure out the problem.

Thanks for your help.

Hubert

Code: HTML/ASPX
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Uploader.aspx.vb" Inherits="Test_Uploader" %>

<%@ Register assembly="EO.Web" namespace="EO.Web" tagprefix="eo" %>

<!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>
    
                <eo:ToolBar ID="ToolBar_Library" runat="server" 
            BackgroundImage="00100103" BackgroundImageLeft="00100101"
                    BackgroundImageRight="00100102" BorderColor="Gray" 
            BorderStyle="None" BorderWidth="0px"
                    ClientSideOnItemClick="Toolbar_LibraryFiles_Click" Height="16px" SeparatorImage="00100104"
                    Style="margin-bottom: 0px" Width="100%">
                    <DownStyle CssText="border-right: #335ea8 1px solid; padding-right: 2px; border-top: #335ea8 1px solid; padding-left: 4px; padding-bottom: 1px; border-left: #335ea8 1px solid; padding-top: 3px; border-bottom: #335ea8 1px solid; background-color: #99afd4; cursor:hand; FONT-SIZE: 12px; FONT-FAMILY: Tahoma;" />
                    <HoverStyle CssText="border-right: #335ea8 1px solid; padding-right: 3px; border-top: #335ea8 1px solid; padding-left: 3px; padding-bottom: 2px; border-left: #335ea8 1px solid; padding-top: 2px; border-bottom: #335ea8 1px solid; background-color: #c2cfe5; cursor:hand; FONT-SIZE: 12px; FONT-FAMILY: Tahoma;" />
                    <Items>
                        <eo:ToolBarItem CommandName="Upload" ImageUrl="00101001" 
                            
                            ToolTip="Ajouter un document de votre ordinateur a cet espace de travail (Upload)">
                        </eo:ToolBarItem>
                    </Items>
                    <ItemTemplates>
                        <eo:ToolBarItem Type="Custom">
                            <NormalStyle CssText="background-color:transparent;border-bottom-style:none;border-left-style:none;border-right-style:none;border-top-style:none;padding-bottom:1px;padding-left:2px;padding-right:2px;padding-top:2px;" />
                            <HoverStyle CssText="background-color:transparent;border-bottom-style:none;border-left-style:none;border-right-style:none;border-top-style:none;padding-bottom:1px;padding-left:2px;padding-right:2px;padding-top:2px;" />
                            <DownStyle CssText="background-color:transparent;border-bottom-style:none;border-left-style:none;border-right-style:none;border-top-style:none;padding-bottom:1px;padding-left:2px;padding-right:2px;padding-top:2px;" />
                        </eo:ToolBarItem>
                        <eo:ToolBarItem Type="DropDownMenu">
                            <NormalStyle CssText="padding-right: 4px; padding-left: 4px; padding-bottom: 3px; border-top-style: none; padding-top: 3px; border-right-style: none; border-left-style: none; border-bottom-style: none; cursor:hand; background-image: url(00100105); background-position-x: right;" />
                            <HoverStyle CssText="border-right: #335ea8 1px solid; padding-right: 3px; border-top: #335ea8 1px solid; padding-left: 3px; padding-bottom: 2px; border-left: #335ea8 1px solid; padding-top: 2px; border-bottom: #335ea8 1px solid; background-color: #c2cfe5; cursor:hand; background-image: url(00100106); background-position-x: right;" />
                            <DownStyle CssText="border-right: #335ea8 1px solid; padding-right: 2px; border-top: #335ea8 1px solid; padding-left: 4px; padding-bottom: 2px; border-left: #335ea8 1px solid; padding-top: 3px; border-bottom: none; background-color:transparent; cursor:hand; background-image: url(00100105); background-position-x: right;" />
                        </eo:ToolBarItem>
                    </ItemTemplates>
                    <NormalStyle CssText="padding-right: 4px; padding-left: 4px; padding-bottom: 3px; border-top-style: none; padding-top: 3px; border-right-style: none; border-left-style: none; border-bottom-style: none; cursor:hand; FONT-SIZE: 12px; FONT-FAMILY: Tahoma;" />
                </eo:ToolBar>
    
    </div>
    <eo:AJAXUploader ID="AJAXUploader_Library" runat="server" AutoPostBack="True" AutoUpload="True"
        BrowseButtonText="Nouveau" CancelButtonText="    " OnFileUploaded="AJAXUploader1_FileUploaded"
        ProgressBarSkin="Windows_Vista" SavePostedFileList="False" StartToolBarButton="ToolBar_Library:Upload"
        TempFileLocation="c:\Temp" Width="16px" ClientSideOnStart="ShowWait">
        <LayoutTemplate>
            <table border="0" cellpadding="2" cellspacing="0" 
                style="width: 264px; font-size: xx-small;">
                <tr>
                    <td class="style3" colspan="2">
                        <asp:PlaceHolder ID="InputPlaceHolder" runat="server">Input Box Place Holder </asp:PlaceHolder>
                    </td>
                </tr>
            </table>
        </LayoutTemplate>
        <CancelButtonStyle CssText="background-image:url('~/Images/Icon_cancel-16.png');background-repeat:repeat;" />
    </eo:AJAXUploader>
    </form>
</body>
</html>



Code: Visual Basic.NET
Partial Class Test_Uploader
    Inherits System.Web.UI.Page
    Protected Sub AJAXUploader1_FileUploaded(ByVal sender As Object, ByVal e As System.EventArgs) Handles AJAXUploader_Library.FileUploaded
        Dim DocID As Integer = 0
        For Each Uploadedfile In AJAXUploader_Library.PostedFiles
            Dim tempFileName As String = Uploadedfile.TempFileName
        Next Uploadedfile

    End Sub
End Class
eo_support
Posted: Tuesday, January 22, 2013 2:42:09 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,195
Hi,

We have tested your code with the latest build and it seems to work fine. What version of EO.Web.dll are you using?

Thanks!
Hub
Posted: Tuesday, January 22, 2013 3:00:35 PM
Rank: Advanced Member
Groups: Member

Joined: 3/16/2010
Posts: 101
version 10.0.28.2
Hub
Posted: Wednesday, January 23, 2013 1:59:36 PM
Rank: Advanced Member
Groups: Member

Joined: 3/16/2010
Posts: 101
Hi,

I did upgrade to 10.0.47.2 and I can reproduce the problem with the test page. The Fileuploaded method executes twice (observed by setting a breakpoint on the first statement "Dim DocID As Integer = 0" )

What could the difference be with between our testing environments?

Hubert
eo_support
Posted: Wednesday, January 23, 2013 4:21:42 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,195
Hi,

I can't think of anything. You can try to create a standalone test project and then send the test project to us. We will then run that and see if we can duplicate the problem.

Thanks!
Hub
Posted: Thursday, January 24, 2013 8:45:35 AM
Rank: Advanced Member
Groups: Member

Joined: 3/16/2010
Posts: 101
Hi,

I have included a simple website (Test Ajax Uploader) which allows me to reproduce the problem here (vs2008).

Thanks for your help.

Hubert
eo_support
Posted: Thursday, January 24, 2013 12:50:27 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,195
Hi,

That's because you hooked up your event handler twice: First in the ASPX through OnFileUploaded="AJAXUploader1_FileUploaded", then in your code through "Handles AJAXUploader_Library.FileUploaded".

Thanks
Hub
Posted: Friday, January 25, 2013 8:10:53 AM
Rank: Advanced Member
Groups: Member

Joined: 3/16/2010
Posts: 101
Thanks so much for your help on this. I had no idea how to investigate further and I was far from finding the problem on my own.

As I said before, your support team is your best sales force.

Thanks

Hubert
eo_support
Posted: Friday, January 25, 2013 10:30:31 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,195
You are very welcome. Glad that we were able to help!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.