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.htmBut 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
|
|
|
|
Rank: Advanced Member
Groups: Administration
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.
|
1 user thanked Dmitry.Obukhov for this useful post.
|
|
|
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.
|
|
|
|
Rank: Advanced Member
Groups: Administration
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.
|
|
|
|
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.