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

Session Variable Help

Status
Not open for further replies.

cyndiee

Technical User
Aug 9, 2002
8
US
If I set a Session Variable to an integer, like:

Session("one") = 1

I can display it by
Alert <%=Session(&quot;one&quot;)%>

But if I set a Session Variable to a string, like:

Session(&quot;two&quot;) = &quot;two&quot;

Alert <%=Session(&quot;two&quot;)%> gives me a blank (null) result. Any ideas why I cannot store a string in a Session variable? I've done this before and it has worked in other ASP pages, but can't understand why I'm having an issue.
 
>> I've done this before and it has worked

Of course it has. Your post indicates a bug in your code.

-pete
[sub]I just can't seem to get back my IntelliSense[/sub]
 
I thought this website/forum was for help with &quot;bug's in code&quot;

Above is not the exact code I used - The assignment is in server-side script. I was hoping someone could assist with why I cannot assign a string to a Session variable when I can assign an integer. I tried using Cstr in thoughts that it might be a type-mismatch, but it makes no difference. I'm not getting any error messages, so any ideas to point me in the right direction would be helpful. Maybe someone else has run into this issue before.
 
>> I thought this website/forum was for help with &quot;bug's in code&quot;

Sorry, after re-reading my post i can see it could be misinterpreted. [hammer]I mean there is a bug in your code that you did not post so we can’t know what it is. And actually it is probably a logic error which might not be stricly considered bugs by some.

-pete
[sub]I just can't seem to get back my IntelliSense[/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top