473,327 Members | 2,025 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Keeping objects between requests within the same session

Don
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
Nov 18 '05 #1
3 1328
Don
"Don" <un*****@oblivion.com> 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
Nov 18 '05 #2
Hi,

HttpContext.Current.Session

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

"Don" <un*****@oblivion.com> 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

Nov 18 '05 #3
Don
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" <jo****@aspalliance.com> wrote in message
news:OC**************@TK2MSFTNGP12.phx.gbl...
Hi,

HttpContext.Current.Session

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

"Don" <un*****@oblivion.com> 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

Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Astra | last post by:
Hi All I've noticed on quite a few ASP sites that when they have a 'MyAccount' section they transfer the site to https and then when you have logged into your account successfully and gone back...
5
by: PJ | last post by:
I posted a few days ago concerning requests being blocked from a main window after a popup window had initiated a file download. Apparently this has to do with the fact that asp.net or iis...
4
by: John Wilcher | last post by:
Environment: Windows 2000 Server, IIS 5.0, ASP .Net Framework 1.1, VB .Net source code We are experiencing a condition that manifests itself as a loss of all session objects. Intermittently...
5
by: Chris Hughes | last post by:
I have an environment with many thousands of client machines uploading data files several times each day to a web server via HTTP PUT. To avoid disk I/O (for performance), I am implementing a...
8
by: Dave Wurtz | last post by:
All, I'm new to ASP development and I have a basic design question: Is it ok to store business objects to session variables or is there a better way to keep object information? For example,...
5
by: Darrel | last post by:
I'm dimming a string at the top of my page so I can use it in several different subs on the page. I'm setting the text in one sub and then reading it in several. I'd like to also use this...
47
by: Max | last post by:
Due to the behaviour of a particular COM object, I need to ensure that a request for a particular ASP page is finalized before another request for the page is processed. Does IIS have a way to...
8
by: Michael Schwarz | last post by:
Hi, I have a problem where I have two requests (i.e. two different windows that are using the same session) that are accessing the session collection. The requests will need more time on the...
7
by: =?Utf-8?B?Vkg=?= | last post by:
Hi, all. Need help with what seems to be either connection, or threading problem in my ASP.NET 2.0 application. The gist of the problem is this: IHttpHandler in my application serves an HTML...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.