Keeping objects between requests within the same session

Discussion in 'ASP .Net' started by Don, Feb 26, 2004.

  1. Don

    Don Guest

    I have an ASP.NET program that references a VB.NET DLL. I had originally
    planned for my DLL to put things in the HttpContext.Current collection so
    that the ASP.NET can access them throughout an entire session (according to
    a tip I saw on a website somewhere), but it turns out that it only lasts for
    the current page request. If another page is requested, the contents of
    HttpContext.Current are cleared. Except for the lack of proper scope,
    HttpContext.Current gives me the functionality that I need.

    Is there another class I can throw this stuff into, similar to the way
    HttpContext.Current works, that will let the objects last for the entire
    session and not just the current request? In ASP.NET there's a Session
    class which has the right scope, but I don't know how -- or even if it's
    possible -- to access that class from by VB.NET DLL.

    - Don
     
    Don, Feb 26, 2004
    #1
    1. Advertising

  2. Don

    Don Guest

    "Don" <> wrote in message
    news:wqt%b.605594$JQ1.508433@pd7tw1no...
    > Is there another class I can throw this stuff into, similar to the way
    > HttpContext.Current works, that will let the objects last for the entire
    > session and not just the current request? In ASP.NET there's a Session
    > class which has the right scope, but I don't know how -- or even if it's
    > possible -- to access that class from by VB.NET DLL.


    I forgot to mention that I need to be able to recreate this class in a
    Windows app. I mean to do this so as to make it seem like a person running
    a Windows app is like one session at a website. Again, HttpContext.Current
    worked perfectly for everything...except that it just had the wrong scope
    for my ASP.NET application.

    - Don
     
    Don, Feb 26, 2004
    #2
    1. Advertising

  3. Don

    Teemu Keiski Guest

    Hi,

    HttpContext.Current.Session

    --
    Teemu Keiski
    MCP, Microsoft MVP (ASP.NET), AspInsiders member
    ASP.NET Forum Moderator, AspAlliance Columnist

    "Don" <> wrote in message
    news:wqt%b.605594$JQ1.508433@pd7tw1no...
    I have an ASP.NET program that references a VB.NET DLL. I had originally
    planned for my DLL to put things in the HttpContext.Current collection so
    that the ASP.NET can access them throughout an entire session (according to
    a tip I saw on a website somewhere), but it turns out that it only lasts for
    the current page request. If another page is requested, the contents of
    HttpContext.Current are cleared. Except for the lack of proper scope,
    HttpContext.Current gives me the functionality that I need.

    Is there another class I can throw this stuff into, similar to the way
    HttpContext.Current works, that will let the objects last for the entire
    session and not just the current request? In ASP.NET there's a Session
    class which has the right scope, but I don't know how -- or even if it's
    possible -- to access that class from by VB.NET DLL.

    - Don
     
    Teemu Keiski, Feb 26, 2004
    #3
  4. Don

    Don Guest

    I tried using that, but when working with my Windows App accessing the DLL,
    the HttpContext.Current.Session resolves to Nothing. Is there some way to
    initialize it? When I had my code working with just HttpContext.Current, I
    needed to put the following line at the start of my Windows app:

    HttpContext.Current = New HttpContext(Nothing, Nothing)

    to initialize it, so to speak (I imagine this is explicitly doing what, in a
    way, the environment is doing for my ASP.NET program). I don't know what to
    do to initialize HttpContext.Current.Session at the start of my Windows app,
    though.

    - Don



    "Teemu Keiski" <> wrote in message
    news:OCzt57K$...
    > Hi,
    >
    > HttpContext.Current.Session
    >
    > --
    > Teemu Keiski
    > MCP, Microsoft MVP (ASP.NET), AspInsiders member
    > ASP.NET Forum Moderator, AspAlliance Columnist
    >
    > "Don" <> wrote in message
    > news:wqt%b.605594$JQ1.508433@pd7tw1no...
    > I have an ASP.NET program that references a VB.NET DLL. I had originally
    > planned for my DLL to put things in the HttpContext.Current collection so
    > that the ASP.NET can access them throughout an entire session (according

    to
    > a tip I saw on a website somewhere), but it turns out that it only lasts

    for
    > the current page request. If another page is requested, the contents of
    > HttpContext.Current are cleared. Except for the lack of proper scope,
    > HttpContext.Current gives me the functionality that I need.
    >
    > Is there another class I can throw this stuff into, similar to the way
    > HttpContext.Current works, that will let the objects last for the entire
    > session and not just the current request? In ASP.NET there's a Session
    > class which has the right scope, but I don't know how -- or even if it's
    > possible -- to access that class from by VB.NET DLL.
    >
    > - Don
    >
    >
    >
     
    Don, Feb 26, 2004
    #4
    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. PJ
    Replies:
    4
    Views:
    514
  2. Fernando Arámburu

    web requests and mobile requests

    Fernando Arámburu, Apr 8, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    458
    Joerg Jooss
    Apr 8, 2005
  3. Replies:
    1
    Views:
    318
    Marek
    Oct 11, 2005
  4. Jazzis
    Replies:
    2
    Views:
    265
    Jazzis
    Sep 23, 2003
  5. Replies:
    1
    Views:
    120
    Ben Morrow
    Nov 29, 2007
Loading...

Share This Page