I have a link (not a textbox) on one ASP page that takes me to a second one
(response.write "<a href=ASP2.asp?" & (photoID) & ">Click here to go to second ASP page</a>"
this link is a field photoID in a record read from a data base, displayed as a link, and then goes back in a "for-next" loop to read the next record.
So in other words you have something like the following...
-
<%
-
For i = 0 To AmountOfLinks
-
%>
-
<a href="link1.asp?id=<%=rs("PhotoID")"%>link1</a>
-
<%
-
Next
-
%>
-
You want to pass PHOTOID into the session...
There's a number of ways you can do this.
If you send the PhotoID through the QueryString you could then pull it down on the next page, and simply set it into the Session.
Session("PhotoID") = Request.QueryString("PhotoId")
So if you have a set of 10 pages, put this at the top of each of them. That way, when the user clicks on any of your links, the photoid pertaining to that link is passed, pulled down on whichever page they click on, and then set into your session.
A more complicated way of doing it would be to have a hidden text field imbedded in your page that displays the links. When a user clicks one of the links a javascript could place the photoID in the text field (hidden from the user) and subsequently submit a form. On the next page you could Request.Form("iPhotoID") to retrieve it, and set it into a session variable.
An even more complicated way of doing it would be to write an AJAX function and invoke it using the OnClick event in javascript. The ajax would call an ASP script in the background and set the session id in a microfraction of a second whilst sending the user to the next page.
It depends on the scenario really.