-
Mar 13th, 2023, 10:30 AM
#1
Thread Starter
Fanatic Member
[RESOLVED] Linking an image to a new webpage to show enlargement of image
I have two images. A small scale and a large scale say picSmall and picLarge of the same picture.
I wish to show the small scale on a web page with text on it saying "Click to enlarge". It must also have a hyperlink to another web page with an image control - say img05
When the user clicks on the image it must redirect to a new web page named Enlarge.aspx with an img05 control on it. It must then show the enlargement of the small scale picture on the new webpage, which must be fetched as target to open in a new window with the page containing the enlarged image then.(on the image click event)
Any help will be appreciated.
Thanks
PK
-
Mar 13th, 2023, 11:02 AM
#2
Re: Linking an image to a new webpage to show enlargement of image
Why does it have to be another page with an image control on it? Why now just link to the image directly and let the browser handle it? That's typically the way I've seen it.
Other wise you'll need to pass the image name or some kind of identifier to the Enlage.aspx page (probably through a querystring) and use that value to then look up the image and return it.
-tg
-
Mar 13th, 2023, 11:47 AM
#3
Thread Starter
Fanatic Member
Re: Linking an image to a new webpage to show enlargement of image
technome,
Yours seemed to me to be the easy way, but the space for the small picture is too small for the large picture, so I will need to show it as an extra div at the bottom of the page, which is not too bad.
Still I have to concoct an event and I need to show text on it.
PK
Last edited by Peekay; Mar 13th, 2023 at 11:51 AM.
-
Mar 13th, 2023, 01:54 PM
#4
Re: Linking an image to a new webpage to show enlargement of image
 Originally Posted by Peekay
technome,
Yours seemed to me to be the easy way, but the space for the small picture is too small for the large picture, so I will need to show it as an extra div at the bottom of the page, which is not too bad.
Still I have to concoct an event and I need to show text on it.
PK
???
techgnome's suggestion wasn't to show the big picture on the same page as the small picture, it was to have the small picture's hyperlink open a path of:
yoursite.com/images/largeimagefilename.jpg
rather than
yoursite.com/Enlarge.aspx
-
Mar 14th, 2023, 01:13 AM
#5
Thread Starter
Fanatic Member
Re: Linking an image to a new webpage to show enlargement of image
OptionBase1,
I do not understand how to do it.
PK
-
Mar 14th, 2023, 03:20 AM
#6
Thread Starter
Fanatic Member
Re: Linking an image to a new webpage to show enlargement of image
I have tried showing the enlarged image on a different .aspx page, and it seems to work except that it cannot find the resource. I have checked the path and filename and it is correct.
It seems to me the Request.QueryString does not pick up the path from the Response.Redirect.
Code in sender:
Code:
Private Sub Image_Click(sender As Object, e As EventArgs) Handles btnImg01.Click, btnImg02.Click, btnImg03.Click, btnImg04.Click
Response.Redirect("~/enlarge.aspx?mylink=" & sender.descriptionurl)
End Sub
Code in receiver:
Code:
rotected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Img05.ImageUrl = Request.QueryString("mylink")
End Sub
PK
-
Mar 14th, 2023, 10:11 AM
#7
Re: Linking an image to a new webpage to show enlargement of image
 Originally Posted by Peekay
OptionBase1,
I do not understand how to do it.
PK
You clearly show you have at least a "copy/paste" understanding of how to redirect someone to a URL. The suggestion is to Response.Redirect to the direct URL of the image itself.
Is that not an option? Are the images not directly accessible as files on your website? Are they stored in a database and your code is fetching them when they are displayed?
-
Mar 15th, 2023, 02:27 AM
#8
Thread Starter
Fanatic Member
Re: [RESOLVED] Linking an image to a new webpage to show enlargement of image
OptionBase1,
I have the links to all the pictures on an Access database - one entry for every webpage and I have webpage ID's to know which record to fetch.
If I have, say, webpage id=7, then it fetches row 7 and in this row I have links to four pictures in very small size and four links to pictures of very large size.
The 4 small size pictures are shown vertically on the right of the webpage as ImageButtons with descriptionurl properties.
When a user clicks on any Imagebutton, I wish to open a new webpage like in target=_blank with the link name to the large picture path.
The pictures are various sizes and I need to size the opening webpage to the size of the picture.
I have succeeded in this to open a webpage within the website/project and show the large picture, but I need to refine it to open a blank webpage and size it to the picture size, and probably place it on a certain locality on the screen.
PK
PS: How do I change this thread back to unresolved?
-
Mar 15th, 2023, 07:31 AM
#9
Re: [RESOLVED] Linking an image to a new webpage to show enlargement of image
Code:
<a href="path/to/your/large/image.jpg" target="_blank"><img src="path/to/your/small/image.jpg"></a>
-tg
-
Mar 15th, 2023, 11:43 AM
#10
Thread Starter
Fanatic Member
Re: [RESOLVED] Linking an image to a new webpage to show enlargement of image
tg,
Thanks, I have that, but I need to write it in ASP.NET.
Maybe you have ideas of sizing the window as well?
PK
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|