Newbie: Selecting image from separate aspx page

C

Colin Peters

I have a form where the user can select an image filename. Clearly it
would be better to allow them to select the image itself rather than key
in the filename.

So, I have a server side directory with the available images. And I have
a page which shows the images as ImageButtons.

My question is: What's the best way to link the two?

Should MyForm.aspx redirect to ImageList.aspx passing "MyForm" in the
query string so that ImageList knows where to redirect back to? It works
but it seems a bit convoluted so I think it must be wrong.

How do you solve this when basically you want to pick from a list of
things which aren't on the calling page?

Hope this makes sense.

In the desktop app environment I'd just open a dialog box. what is the
asp.net paradigm?
 
S

Stefan

You could simulate a dialog box by using window.open("ImageBox.aspx")
and then add some javascript in the onclick of the Select Button in
the ImageBox codebehind, which
- sets the image in the calling page (window.opener.getElementByID...)
- closes the imagebox window

So - mainly you have to deal with some javascript and DHTML

As to your original question: For easy pageflows I just put the
refering
page in the session/context items/request, which is not elegant, but
simple.
Alternatively you can implement a pageflow manager which can take
care of more complex navigations. Also worth looking at is
Server.Execute instead of redirect or transfer (and having a refering
page property defined in a page base class). There are really
a lot of options here and it is up to your preferences and requirements
to decide which one you want to go with.

-Stefan
 
C

Colin Peters

Thanks Stefan.

I guess the session is a better place rather than clogging up the
querystring. I think I need a bit of practise to get into Web way of
doing things.

Colin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top