Results 1 to 10 of 10

Thread: [RESOLVED] Linking an image to a new webpage to show enlargement of image

  1. #1

    Thread Starter
    Fanatic Member Peekay's Avatar
    Join Date
    Sep 2006
    Location
    Witbank, South Africa
    Posts
    784

    Resolved [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

  2. #2
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,532

    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
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3

    Thread Starter
    Fanatic Member Peekay's Avatar
    Join Date
    Sep 2006
    Location
    Witbank, South Africa
    Posts
    784

    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.

  4. #4
    PowerPoster
    Join Date
    Nov 2017
    Posts
    3,116

    Re: Linking an image to a new webpage to show enlargement of image

    Quote Originally Posted by Peekay View Post
    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

  5. #5

    Thread Starter
    Fanatic Member Peekay's Avatar
    Join Date
    Sep 2006
    Location
    Witbank, South Africa
    Posts
    784

    Re: Linking an image to a new webpage to show enlargement of image

    OptionBase1,

    I do not understand how to do it.

    PK

  6. #6

    Thread Starter
    Fanatic Member Peekay's Avatar
    Join Date
    Sep 2006
    Location
    Witbank, South Africa
    Posts
    784

    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

  7. #7
    PowerPoster
    Join Date
    Nov 2017
    Posts
    3,116

    Re: Linking an image to a new webpage to show enlargement of image

    Quote Originally Posted by Peekay View Post
    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?

  8. #8

    Thread Starter
    Fanatic Member Peekay's Avatar
    Join Date
    Sep 2006
    Location
    Witbank, South Africa
    Posts
    784

    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?

  9. #9
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,532

    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
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  10. #10

    Thread Starter
    Fanatic Member Peekay's Avatar
    Join Date
    Sep 2006
    Location
    Witbank, South Africa
    Posts
    784

    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
  •  



Click Here to Expand Forum to Full Width