Having trouble getting at the value of a Session variable

Discussion in 'ASP .Net' started by =?Utf-8?B?dHBlcnJp?=, Jun 6, 2005.

  1. 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
     
    =?Utf-8?B?dHBlcnJp?=, Jun 6, 2005
    #1
    1. Advertising

  2. 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
    >
    >
     
    =?Utf-8?B?Smlt?=, Jun 7, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jake Barnes
    Replies:
    0
    Views:
    737
    Jake Barnes
    Jan 25, 2006
  2. Pyenos
    Replies:
    9
    Views:
    292
    WaterWalk
    Dec 29, 2006
  3. Guest
    Replies:
    2
    Views:
    161
    why the lucky stiff
    Oct 7, 2004
  4. Andy Pipes
    Replies:
    6
    Views:
    130
    Andy Pipes
    Sep 30, 2008
  5. Jake Barnes
    Replies:
    2
    Views:
    84
Loading...

Share This Page