Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

carrying a variable through a link - ASP

  • 20-06-2003 04:11PM
    #1
    Registered Users, Registered Users 2 Posts: 1,747 ✭✭✭


    I think this is the best way to do it but im not sure and i dont know how so your help would be very much appreciated. The online version of what im talking about is here: http://www.dgi.ie/polls/pollmentor.asp
    First 2 images work.


    On a page of about 50 tumbnail images (numbered 1-50) i have a link coming from each image that looks like this:


    <a href="../t_images/close_up/close_up<%=nCount%>.asp" target="_blank">

    <img src="../t_images/designs/design<%=nCount%>.gif" border="0"/>

    </a>



    The page it opens contains a larger version of the tumbnail with 2 links at the bottom to view the image number above and below the current one.

    Now i dont want to be creating 50 individual pages to show the larger images when im pretty sure it could be done in one asp page.

    What i want to know is how do i carry this variable <%=nCount%> over to the new window.

    What will the new page look like?
    i think i can do most of this bit but how do you get the links at the bottom to go one number above and one below as well as not showing a link for the previous image if current is 'design1'
    And the same for 'design50'

    I hope that makes sense and thanks for taking the time.


Comments

  • Registered Users, Registered Users 2 Posts: 437 ✭✭Spunj


    You want to have a link to the same asp page and use the count variable to display the image based on its name by passing it to the new page in the querystring.

    E.g. href="blah.asp?id=<%=nCount%>"

    ---
    blah.asp

    id = Cint(Request("id"))

    ..blah blah
    <img src="../t_images/designs/design<%=id%>.gif" border="0"/>
    ..blah blah


    Something along those lines will sort ya out.


  • Registered Users, Registered Users 2 Posts: 1,268 ✭✭✭hostyle


    <%

    nCount = int(Request("imagenum"))

    %>


    <a href="../t_images/close_up/close_up.asp?imagenum=<%=nCount-1%>" target="_blank">

    <img src="../t_images/designs/design<%=nCount-1%>.gif" border="0"/>

    </a>


    <a href="../t_images/close_up/close_up.asp?imagenum=<%=nCount+1%>" target="_blank">

    <img src="../t_images/designs/design<%=nCount+1%>.gif" border="0"/>

    </a>


    You'll have to do some extra checking to see if there is a previous and next image but that should get you going ...


  • Registered Users, Registered Users 2 Posts: 1,747 ✭✭✭Figment


    Brilliant, cheers lads.


  • Registered Users, Registered Users 2 Posts: 1,747 ✭✭✭Figment


    works a charm :)


Advertisement