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

Status
Not open for further replies.

erics55

Programmer
Nov 20, 2006
30
SE
hi
in VS 2002 to create a session variable all i needed to do it declare it in the global.asax file and away we go. that doesnt seem to work in 2005, does anyone know why?
Thanks
 
You don't have to create a session variable in the global asax.. you can create it anywhere in code behind
Session("MyVar") = "This is my Session Variable")
 
Hi mate, thanks for your reply

I have added a session variable when my inital page opens and then tried to call it in a page that is opened later and the variable equals nothing.

is there anyting else i need to do?
 
I have now tried it in the same procedure

session("strTemp") = "xxx"
dim strX as string
strX = session("strTemp")

and strX = nothing at runtime

thanks for your time
 
thanks mate

the problem was with on particular page i had imported form another site. I have just rebuilt the page and it works fine now

thanks for your time
 
Sorry I haven't gotten back to you .. got tied up here at work.. but seems you got it resolved... :)

Jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top