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!

Having trouble getting a Session variable's value

Status
Not open for further replies.

Cenedra

Programmer
Jan 2, 2003
114
US
Hi everyone, I have an .aspx file that is used by an external program to perform a function. There is no code behind, all code and HTML is contained in one file.

the structure is like this:

<% string strBlah = Request.Querystring("jdkfsd");

string userid = Convert.ToString(HttpContext.Current.Session["UserID"]);


// more variables assigned from query string

%>

<html>
code here
</html>


The variables that are retrieving data from the QueryString are working great, but for some reason I can not get the value in my session variable.

I can not change the format of this file, so, I'm kinda stuck there.

Does anyone have any idea of how I can get the Session variable value into struserid?

Thank you in advance for the help,


 
I'm assigning the value when a person logs in. This page is accessed after a person logs in and the variable is set. I use the above syntax to access the value of the Session variable in other places and it works just fine.
 
Are you sure the session variable isn't holding a blank string and that it's definitely set to something at this point?

Rhys

"Vampireware /n/,a project, capable of sucking the lifeblood out of anyone unfortunate enough to be assigned to it, which never actually sees the light of day, but nonetheless refuses to die."

"I see dead pixels!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top