Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Postback Images and text. 1

Status
Not open for further replies.

kjohnson530

IS-IT--Management
Mar 26, 2006
28
US
I hope someone might be able to help me become a bit less clueless. I have a couple of items I'm hoping will add some flavor to my website. I believe these questions to be related, otherwise I would post to separate threads.

1. I have a home page that displays an image. I'm interested in displaying 3 or 4 thumbnails of other pictures next to it. When a user clicks on a thumbnail I would like the main image to be replaced with the larger version of the selected thumbnail.

2. I would like to be able to modify the text in a div layer based upon on the same page based up my java menu. For example I want to have a News clip comeup when the page is first accessed, and would like to have a button that changes that text to display our mission statement when the mission button is pushed.

With this said, I am not real sure how to go about doing these things in ASP.

Thank you for you rhelp in advance.
 
You can make the 3 or 4 other thumbnails into links with different values in the QueryString.
[tt]
<a href=default.asp?show=1><img source=photo1.jpg></a>
<a href=default.asp?show=2><img source=photo2.jpg></a>
<a href=default.asp?show=3><img source=photo3.jpg></a>
<a href=default.asp?show=4><img source=photo4.jpg></a>
[/tt]

Then you make your page check the QueryString to determine which photo to show with something like this:
[tt]
SELECT CASE Request.QueryString("show")
CASE 1
MainImage = "photo1.jpg"
CASE 2
MainImage = "photo2.jpg"
CASE 3
MainImage = "photo3.jpg"
CASE 4
MainImage = "photo4.jpg"
CASE ELSE
'if nothing was specified show photo #1
MainImage = "photo1.jpg"
END SELECT

<! -- Other HTML stuff goes here -->

<img source=[highlight]<%= MainImage %>[/highlight]>

[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top