Forums

Welcome Guest Search | Active Topics | Members

Image Uploader ASP.NET Control Options
trancehead
Posted: Monday, July 21, 2008 3:31:29 AM
Rank: Newbie
Groups: Member

Joined: 7/17/2008
Posts: 4
Points: 12
Hi,

Since posting my question I have managed to get it working by setting the action to a different page.

The new problem is that the upload sub is always being called even when it is just a normal postback. It then loses all the postback events i.e. just shows a blank page and the page_load event is never fired.
Fedor
Posted: Monday, July 21, 2008 3:58:58 AM

Rank: Advanced Member
Groups: Administration , Member

Joined: 7/28/2003
Posts: 1,235
Points: -208
Location: WA, US
Quote:
The new problem is that the upload sub is always being called even when it is just a normal postback. It then loses all the postback events i.e. just shows a blank page and the page_load event is never fired.


Could you post your code?

Best regards,
Fedor Skvortsov
trancehead
Posted: Monday, July 21, 2008 4:09:32 AM
Rank: Newbie
Groups: Member

Joined: 7/17/2008
Posts: 4
Points: 12
Quote:

<asp:Panel ID="pnlAddPic" runat="server" CssClass="modalPopup UploadModal" Style="display: none;">
<p style="text-align: center;">
Select the photos you would like to upload, add a title if you want and then click
the send button<br />
<Aurigma:ImageUploader ID="imgUpload" runat="server" Height="500px" Width="580px"
ShowDebugWindow="false" ScriptsDir="~/Scripts" AllowFolderUpload="false" UploadSourceFile="false"
EditDescriptionText="add title" RememberLastVisitedFolder="true" UploadThumbnail1ResizeQuality="High"
UploadThumbnail1JpegQuality="100" UploadThumbnail1FitMode="Width"
UploadThumbnail1Width="600" MaxFileSize="1048576" FileMask="*.jpg;*.jpeg;*.jpe;*.bmp;*.gif" />
</p>
<p style="text-align: center;">
<asp:LinkButton ID="CancelButton" runat="server" Text="<< Cancel" CssClass="invite" />
</p>
</asp:Panel>
<asp:ModalPopupExtender ID="mpeAddPic" runat="server" TargetControlID="lnkAddBottom"
PopupControlID="pnlAddPic" BackgroundCssClass="modalBackground" CancelControlID="CancelButton" />
<asp:ModalPopupExtender ID="mpeAddPicTop" runat="server" TargetControlID="lnkAddTop"
PopupControlID="pnlAddPic" BackgroundCssClass="modalBackground" CancelControlID="CancelButton" />
Fedor
Posted: Sunday, July 27, 2008 11:39:33 PM

Rank: Advanced Member
Groups: Administration , Member

Joined: 7/28/2003
Posts: 1,235
Points: -208
Location: WA, US
Do you upload at the same time files using <asp:FileUpload > element?

Here is source code of Image Uploader control where it handles file upload:

Code:
            protected override void OnInit(EventArgs e)
            {
                  base.OnInit(e);

                  if (Page.Request.Files.Count > 0)
                  {
                        for (int i = 0; i < Page.Request.Files.Count; i++)
                        {
                              HttpPostedFile file = Page.Request.Files[i];

                              FileUploadEventArgs args = new FileUploadEventArgs(file);

                              OnFileUploaded(args);
                        }

                        HttpContext.Current.Response.End();
                  }
            }


As you see, if request contains some uploaded files, then it raise FileUploaded event for each file and then ends response (HttpContext.Current.Response.End();). After no other page events are raised.

Best regards,
Fedor Skvortsov
trancehead
Posted: Monday, July 28, 2008 1:03:34 AM
Rank: Newbie
Groups: Member

Joined: 7/17/2008
Posts: 4
Points: 12
I think the problem may be HttpContext.Current.Response.End();

I was posting back to the same page and this would have effectively stopped it. I have used a different solution so I won't be able to test if this would actually work or not.

One thing I did struggle with was how to get the descriptions in the postback?
Fedor
Posted: Monday, July 28, 2008 2:23:09 AM

Rank: Advanced Member
Groups: Administration , Member

Joined: 7/28/2003
Posts: 1,235
Points: -208
Location: WA, US
You can try to replace in control source code:

Code:
if (Page.Request.Files.Count > 0)


to

Code:
if (!String.IsNullOrEmpty(Page.Request.Form["PackageGuid"]))


Image Uploader always send PackageGuid field in post request. We will fix in next control release.

Quote:
One thing I did struggle with was how to get the descriptions in the postback


Description is stored in Request.Form["Description_N"] field of request. You can get access to it at any time.

Best regards,
Fedor Skvortsov
ndevil
Posted: Thursday, August 07, 2008 12:24:55 AM
Rank: Newbie
Groups: Member

Joined: 8/7/2008
Posts: 1
Points: 3
Good day.

I'm using Visual Studio 2008 and control does not render in the designer. The error shown on the control is:

Error Rendering Control - ImageUploader1
Request is not available in this context.

I have checked the reference to the dll.

It works in VS2005.

Please assist.

Regards
Fedor
Posted: Monday, August 18, 2008 3:28:07 PM

Rank: Advanced Member
Groups: Administration , Member

Joined: 7/28/2003
Posts: 1,235
Points: -208
Location: WA, US
I am sorry for delay. I was on business trip last 2 weeks.

I confirm the problem. I will prepare update ASAP.

Best regards,
Fedor Skvortsov
Fedor
Posted: Monday, August 18, 2008 7:49:53 PM

Rank: Advanced Member
Groups: Administration , Member

Joined: 7/28/2003
Posts: 1,235
Points: -208
Location: WA, US
Quote:
I'm using Visual Studio 2008 and control does not render in the designer. The error shown on the control is:

Error Rendering Control - ImageUploader1
Request is not available in this context.

I have checked the reference to the dll.

It works in VS2005.


You need to change in OnInit of ImageUploader (ImageUploader.cs) from:


Code:
                  base.OnInit(e);

            if (Page.Request.Files.Count > 0)
            {
                for (int i = 0; i < Page.Request.Files.Count; i++)


to:

Code:
                  base.OnInit(e);

            if (!DesignMode && Page.Request.Files.Count > 0)
            {
                for (int i = 0; i < Page.Request.Files.Count; i++)


I will include this fix to next major ASP.NET control update.

Best regards,
Fedor Skvortsov
Rob@Sask
Posted: Wednesday, August 27, 2008 12:51:28 PM
Rank: Newbie
Groups: Member

Joined: 8/27/2008
Posts: 2
Points: 6
Hey all,

I am new to the Aurigma product and trying to figure out something. I want to use the ASP.NET control version to place the upload tool in my ASP.NET page. I can do that using the basic control example as outlined on this site but what I want to do is to be able to customize the preview pane to allow the user to be able to enter in several fields worth of information.

I've looked at the Multiple Descriptions Sample and are able to make that work using a javascript-based approach. My question is how do I do so using ASP.NET controls? I've tried to simply substitute the <script>....</script> section in the body of the sample page for an <cc1:ImageUploader>...</> tag but it does not seem to show the preview pane when I do this approach.

Can someone assist in how to have a template visible for each image that is being uploaded in the pane at the bottom so I can have the appropriate input entered wit the photo?

Thanks,
Robin
Fedor
Posted: Wednesday, August 27, 2008 2:03:41 PM

Rank: Advanced Member
Groups: Administration , Member

Joined: 7/28/2003
Posts: 1,235
Points: -208
Location: WA, US
Hello,

I think it is better now to go forward without ASP.NET control. You should implement it the usual way using iuembed.js script. Just see Multiple Description sample and go forward with it.

Best regards,
Fedor Skvortsov

Best regards,
Fedor Skvortsov
Rob@Sask
Posted: Wednesday, August 27, 2008 2:21:59 PM
Rank: Newbie
Groups: Member

Joined: 8/27/2008
Posts: 2
Points: 6
Thanks Fedor!
bob_us
Posted: Friday, August 29, 2008 5:14:01 PM
Rank: Newbie
Groups: Member

Joined: 8/29/2008
Posts: 2
Points: -91
Hi,

I am developing a website for my friends company and iam thinking of using this control.

First thing

a) Is this a free control or do i need to buy. We will only use it on the website so that the users can upload multiple images.

b) i am trying to run the sampe and when i run i iam getting a error abt Missing some files like ImageUploader5.cab,ImageUploader5.jar,iuembed.js etc..

I looked for these files in the source directory and i obviouly i dont fiind them

How do i get those files and where do i download them.

Thanks,
Bob
Fedor
Posted: Friday, August 29, 2008 5:35:59 PM

Rank: Advanced Member
Groups: Administration , Member

Joined: 7/28/2003
Posts: 1,235
Points: -208
Location: WA, US
Bob, currently this ASP.NET control is wrapper around Image Uploader Dual control:

http://www.aurigma.com/Products/ImageUploader/

You can download evaluation version of it (with .CAB, .JAR, and JS files) here:

http://www.aurigma.com/Products/ImageUploader/FreeTrial.aspx

As for licensing please read here:

http://www.aurigma.com/Products/ImageUploader/Licensing.aspx



Best regards,
Fedor Skvortsov
bob_us
Posted: Friday, September 05, 2008 9:15:01 PM
Rank: Newbie
Groups: Member

Joined: 8/29/2008
Posts: 2
Points: -91
Iam trying to use the multifiledemo .. i have set it up...

first thing is it doesnt allow the drag and drop...

second thing is how do i call the ImageUploader1_FileUploaded() method ... i dont know if i need to add a event in the java script? which i have done like this

iu.addEventListener("OnFileUploaded", "ImageUploader1_FileUploaded").... still the code aint reaching the ImageUploader1_FileUploaded ....

So iam getting the files in the Page_load which i dont like because the first time the page is loading i dont have no files and so it throws an error... but iam implementing it in a wrong way with blank Catch( ) i,.e catching error and doing nothing...

third thing i need to know is how to show the error message ... or change the message that the java script throws like File Uploaded... i need to chnage those..

and say soem thing like Upload complete.. and do some thing else or better redirect them to another page without even showing that alert of filesuploaded...

Thanks in Advance :)

Bob
Users browsing this topic
Guest


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.

Main Forum RSS : RSS

YAFVision Theme Created by Jaben Cargman (Tiny Gecko)
Yet Another Forum.net version 1.9.1.6 running under Cuyahoga.
Copyright © 2003-2006 Yet Another Forum.net. All rights reserved.