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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

session variables 2

Status
Not open for further replies.

bauerle

Programmer
Dec 13, 2004
4
BR
Actually the rpoblem is I have a loop of forms and in each form I have a different value to the same variable name. I have to choose one of these to attribute to the session variable. Can someone help? Thamx again.
 
how do you determine which value you will be assigning to the session variable? once you've selected the value to assign to it, it would be Session("sessionname")=Value as pgferro responded in your last message, where Value = Request.Form("fieldvalue")
 
Sorry to keep on disturbing you guys...
But can you tell me how to call back that session variable from another asp file?
thnx .. :)
 
Session variables are....session variables, so you can call their contents from any asp page that is opened during that session. For example you set a Session Variable when a user logs in, and until the user closes its browser or the sessione expires (default 20 minutes) the content of the session will always be available just calling it.
If you want to go deeper in the subject, just browse one of the dozens good asp sites and search for it..

Bye
 
Create a Session Variable OR Change an Existing Session Variable uses the same method:

Session("username") = "Visitor Name"




Examples to access that Session Variable on another page:

Response.Write Session("username")

dim username
username = Session("username")

<html>
<body>
Your Name Is: <%=Session(&quot;username&quot;)%>
</body>
</html>


Hope this helps.

ToddWW
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top