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

Session Variable

Status
Not open for further replies.

JustWondering

Technical User
Jun 28, 2003
57
US
Hi,

Please help me with thsi easy one, I forgot the systax:

I page, I want to set the session var = value of a drop down box.

Then I want to set the text box of the next page euqals to this session var.

I try something like:

Session("Val")=Request("DDBox") (DDBox is the name of my drop down box)

In the next page, I try:

<input name=&quot;text1&quot; value=&quot;Response.Write(Session(&quot;Val&quot;))&quot;>

But I value didn't show in this text box.

Thanks
 
Hi...
I think you just forget the ASP tags...
<input name=&quot;text1&quot; value=&quot;<%=Session(&quot;Val&quot;)%>&quot;>

----
TNX.
E.T.
 
Thanks ehsant. Yes, I forgot the ASP tags on my post but I do have have ASP tags on my code.
 
Hi...
so, you mean you still have the same problem with your session variable ?

----
TNX.
E.T.
 
If I understand correctly, you have two pages. On page one, you have a drop down box. You are trying to set the session variable Session(&quot;Val&quot;) equal to the value of the Request(&quot;DDBox&quot;) on the same page? Then you are trying to read the Session(&quot;Val&quot;) on the next page.

If this is the case, it will not work in this manner. You cannot set the session value in this way because you have to first submit the page. There are probably several different ways around this. You can simply set the variable on page 2 equal to the request(&quot;DDBox&quot;) variable. You could also set the session value on page 2 and then reference that later in the page as you have done.

If this belief is wrong, perhaps some further detail would help. HTH

Human beings, who are almost unique in having the ability to learn from the experience of others, are also remarkable for their apparent disinclination to do so.
--Douglas Adams
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top