Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
Daf  
#1 Posted : Tuesday, June 16, 2009 1:36:08 AM(UTC)
Daf

Rank: Member

Groups:
Joined: 6/16/2009(UTC)
Posts: 16

Thanks: 1 times
Hi,

Currently on Evaluation copy - using .Net integration.

Control is currently on the page from design time.

Doing some initialisation via .Net Server-side method : ImageUploader1_Init

Then handling the saving of files via : ImageUploader1_FileUploaded

I'm renaming files before storing - saving the old names in the database.

Is there a way I can add parameters to the RedirectURL so that it knows which database entries were just uploaded ?

I'd rather do it like this if possible rather than save an XML file as in the examples.

I've looked up AfterUpload event handler but can't work out a way to update it with the new ID's since the Response is sent back to the control not the page.

Or maybe get the server side code to do the redirect instead.

I guess I won't be able to use ImageUploader1_FileUploaded then ? Change to using Page_Load and coding it by hand... ?

Daf  
#2 Posted : Tuesday, June 16, 2009 6:39:33 PM(UTC)
Daf

Rank: Member

Groups:
Joined: 6/16/2009(UTC)
Posts: 16

Thanks: 1 times
Found one way although its a bit of a hack.

In

ImageUploader1_FileUploaded

Keep a record of all the new/adjust IDs (or files names) using something like a List<>.

Then at the end of the server side function

Code:
        if (e.FileIndex == e.FileCount)
        {
            //redirect code
        }

Can redirect here.

Either putting the ID's as a list of parameters OR for more complex parameters - you can expose them as public properties in the source page and then read from the target page using:

Code:
<%@ PreviousPageType VirtualPath="~/SourcePage.aspx" %>
in the target page

See : http://msdn.microsoft.co...us/library/6c3yckfw.aspx

BUT the disadvantage of this method (I think) is that you won't get the tools "Upload Ok" message.

Daf  
#3 Posted : Tuesday, June 16, 2009 6:43:39 PM(UTC)
Daf

Rank: Member

Groups:
Joined: 6/16/2009(UTC)
Posts: 16

Thanks: 1 times
Sometimes I've seen the AfterUpload client side function shown as :

Code:
function ImageUploader_AfterUpload(Page)
{
    window.location = Page;
}

How does the "Page" parameter get populated ?

Is it possible to do this from Server-side ImageUploader1_FileUploaded function ?

Daf  
#4 Posted : Wednesday, June 17, 2009 12:51:09 AM(UTC)
Daf

Rank: Member

Groups:
Joined: 6/16/2009(UTC)
Posts: 16

Thanks: 1 times
AH! It's a simple Response.Write !

Although simple I didn't see it in the documentation at all. Eventually found it on here after much trawling.

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.