Meet us at PRINT 19. Chicago, IL. Oct. 3 - 5.
Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
hcaltenco  
#1 Posted : Tuesday, September 18, 2012 2:36:56 AM(UTC)
hcaltenco

Rank: Newbie

Groups: Member
Joined: 1/24/2012(UTC)
Posts: 4

Thanks: 2 times
Hi,

I am trying to set a BeforeUpload event that depends on the state of a checkbox. But as soon as I add a BeforeUpload event as a client event in asp.net the aurigma uploader control disappears.

I am following the BeforeUpload event documentation at:
http://www.aurigma.com/d...ploader_BeforeUpload.htm

But something must be missing. See the code below:

Code:

    <aur:ImageUploaderFlash ID="ImageUploaderFlash1" runat="server" Height="200px" Width="100%"
        OnFileUploaded="FileUploaded" OnAllFilesUploaded="AllFilesUploaded"
        LicenseKey="<%$ AppSettings:ImageUploaderLicenseKey %>" >
        <ClientEvents>
            <aur:ClientEvent EventName="BeforeUpload" HandlerName="onBeforeUpload" />
        </ClientEvents>
        <Converters>
            <aur:Converter Mode="*.*=Thumbnail" ThumbnailWidth="1600" ThumbnailHeight="1600" />
        </Converters>
        <Restrictions FileMask="[['Images (*.jpg;*.jpeg;*.png;*.gif;*.bmp)', '*.jpg;*.jpeg;*.png;*.gif;*.bmp']]" />
    </aur:ImageUploaderFlash>
    <asp:CheckBox id="CheckBox_AddToDay" text="Also add to day" runat="server" onclick="check(this);" style="float:right"/>
    <script type="text/javascript">
        var addtoday = false;
        function check(cb) {
            //document.getElementById('<%=CheckBox_AddToDay.ClientID %>').checked = cb.checked;
            //<%:addtoday %> = cb.checked;
            //PageMethods.Check_Clicked();
            addtoday = cb.checked;
            alert(cb.checked);
        }
        function onBeforeUpload() {
            // Get folder name
            alert(addtoday);

            // Add folder name field
            this.metadata().addCustomField('addto', addtoday);
        }
    </script>

Edited by user Tuesday, September 18, 2012 2:38:35 AM(UTC)  | Reason: Not specified

Dmitry.Obukhov  
#2 Posted : Tuesday, September 18, 2012 11:34:34 PM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

Groups:
Joined: 5/29/2010(UTC)
Posts: 1,310

Thanks: 8 times
Was thanked: 111 time(s) in 111 post(s)
Please put the JavaScript (<script></script>) block over the uploader ASP.NET control. Image Uploader should appear.
Best regards,
Dmitry Obukhov
Technical Support. Aurigma, Inc.
thanks 1 user thanked Dmitry.Obukhov for this useful post.
hcaltenco on 9/19/2012(UTC)
hcaltenco  
#3 Posted : Wednesday, September 19, 2012 12:18:44 AM(UTC)
hcaltenco

Rank: Newbie

Groups: Member
Joined: 1/24/2012(UTC)
Posts: 4

Thanks: 2 times
Thanks Dmitry,

that did the trick. I am used to putting javascripts always below the HTML code, never had a problem until now.

Dmitry.Obukhov  
#4 Posted : Wednesday, September 19, 2012 12:23:11 AM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

Groups:
Joined: 5/29/2010(UTC)
Posts: 1,310

Thanks: 8 times
Was thanked: 111 time(s) in 111 post(s)
I have often experienced this problem myself :)
Best regards,
Dmitry Obukhov
Technical Support. Aurigma, Inc.
Users browsing this topic
Forum Jump  
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.