Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Having trouble getting at the value of a Session variable

Reply
Thread Tools

Having trouble getting at the value of a Session variable

 
 
=?Utf-8?B?dHBlcnJp?=
Guest
Posts: n/a
 
      06-06-2005
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,
tperri


 
Reply With Quote
 
 
 
 
=?Utf-8?B?Smlt?=
Guest
Posts: n/a
 
      06-06-2005
The question is, why do you expect "UserID" to be stored in the session?
Where was it set in the first place?

You mention the page is used by an 'external program', if it's making web
requests to your page in code, is it using a cookie store to enable session
tracking? Or am I not understanding this?

Jim

"tperri" wrote:

> 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,
> tperri
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Having trouble understanding function scope and variable scope Andrew Falanga Javascript 2 11-22-2008 09:23 PM
Merging hashes and having trouble with variable scope! Andy Pipes Ruby 6 09-30-2008 02:43 PM
System Session Variable VS. Own-declared 'Session' Variable chowchho ASP .Net 7 03-28-2008 02:38 PM
I'm having trouble understanding scope of a variable in a subclass Pyenos Python 9 12-29-2006 01:14 AM
Having Trouble getting network setup in windows XP =?Utf-8?B?UldX?= Wireless Networking 0 02-27-2005 08:07 PM



Advertisments