Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Nov 6th, 2005, 8:01 PM   #1
raikkonen
Newbie
 
Join Date: Jun 2005
Posts: 29
Rep Power: 0 raikkonen is on a distinguished road
ASP Popup Window

Hi all, this is what i would like to do. I have an original page,showing many small images. But i would like the user to be able to click on it and a popup window will appear,showing an enlarged image. How do i do that?
I know firstly i will need to generate a pop up window by using that window.opener something,could some one help?

Also,i have stored both the small images and the enlarged images in my database so how do write the code for the popup window to show the respective enlarged images when i click on each of their small image?

Please help!!!

Thanks...
raikkonen is offline   Reply With Quote
Old Nov 7th, 2005, 8:26 AM   #2
Agent 47
Hobbyist Programmer
 
Agent 47's Avatar
 
Join Date: Nov 2005
Posts: 122
Rep Power: 3 Agent 47 is on a distinguished road
You need JavaScript for that...

Yould make an image 'container' page in asp that takes in a parameter
from the url that tells it which image to load.
Dim image
image=Request.QueryString('img')
Response.Write("<img src='"&image&"' alt='Big Image' />")

To open the page you just need something like:
<a href="image.asp?img=path_to_pic.gif" onclick="return !window.open(this.href, 'image_window', 'width=400,height=400');">
   <img src="path_to_thumbnail.gif" alt="Thumbnail" style="border-style:none;" />
</a>

HTH,

--47.
__________________
"I'm going to become rich and famous when I invent a device that allows you to stab people in the face over the internet"
Agent 47 is offline   Reply With Quote
Old Nov 7th, 2005, 7:25 PM   #3
raikkonen
Newbie
 
Join Date: Jun 2005
Posts: 29
Rep Power: 0 raikkonen is on a distinguished road
thanks,but where do u get the variable 'image_window' from?? and also,what does this.href mean . ? sorry i'm kinda lousy at programming stuff =(

and oh yes,that part about the 'path_to_pic' and 'path_to_thumbnail'.. what does that mean? it's not a specific path like 'pic1.gif' right? because i want each pic to load when i click on each of the respective thumbnails and not just a specific one.. =x

Currently this is what my code looks like:

<tr>
<td rowspan=4 width=100><img src="<%=RS("WholeCakesSImage").value%>"></a>
</td>

so how do i put in the a href so that when i click on their respective thumbnails,their enlarged image will appear in a pop up? also .... i understand that here the popup box's name is image.asp. so what exactly am i supposed to code inside that page??

Edit: So sorry for that so many questions... i've tried out your code and i've got the popup box already,just that when i click on it (the thumbnail),the popup box appears with nothing.As in,just a plain white popup box. How do i pass in the enlarged image in there?

Last edited by raikkonen; Nov 7th, 2005 at 7:49 PM.
raikkonen is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 9:10 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC