Results 1 to 3 of 3

Thread: RSLV-Not able to access Application & Session variables in standard modules & classes

  1. #1

    Thread Starter
    Hyperactive Member Utpal's Avatar
    Join Date
    Feb 2002
    Location
    Mumbai, India
    Posts
    393

    RSLV-Not able to access Application & Session variables in standard modules & classes

    Hi everybody,

    In my web project, I have initialized an application variable in Application_Start event in Global.asax and initialized a session variable in Default.aspx (startup page). I want to access these variables in procedures and functions in my standard modules and also in my classes, which I am not able to do. Why are they not accessible in standard modules and classes? Is there any way I could do that?
    Last edited by Utpal; Apr 8th, 2005 at 04:26 AM. Reason: Resolved
    It is easy when you know it.

  2. #2
    PowerPoster
    Join Date
    Nov 2001
    Location
    Trying to reach and stay in the cloud
    Posts
    2,089

    Re: Not able to access Application & Session variables in standard modules & classes

    I beileve its because the Page "Context" is not accessible through classes and so the session is not available.

  3. #3

    Thread Starter
    Hyperactive Member Utpal's Avatar
    Join Date
    Feb 2002
    Location
    Mumbai, India
    Posts
    393

    Re: Not able to access Application & Session variables in standard modules & classes

    I found the solution in another forum. They can be accessed by prefixing the variables with System.Web.HttpContext.Current.
    It is easy when you know it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width