By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,760 Members | 1,630 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,760 IT Pros & Developers. It's quick & easy.

Modules and Sessions and Events

P: n/a
dt
I'm trying to create a drop-in dll that will run as a module on an
existing application with just one web.config change. However, it is
necessary to maintain state within the module. I don't think that I'm
using the events correctly.

Can I only manipulate session between AcquireState and ReleaseState
events? Does that mean in BeginRequest or EndRequest, the session is off
limits? I keep getting "not a reference," and, well, that seems to
corroborate my theory.

Can I RewritePath and intercept status codes elsewhere in the chain,
like PreRequest and PostRequest (hopefully)? Or are there restrictions?
If so, can I roll my own session using BeginRequest and EndRequest?

Is there a better way to handle the desire to RewritePaths based on
session?

Thanks,
-dt
Nov 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hi dt:

That's right, the Session collection hasn't been associated with the
request until AcquireRequestState.

If you just need to pass information along for the duration of the
request you could use the HttpContext.Items collection. It works just
like the Session, and is available from BeginRequest to EndRequest.
The primary difference is that Items is only available for one
request, then it's gone.

I have some more details here:

The HttpContext Items Collection
http://odetocode.com/Articles/111.aspx

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Mon, 27 Jun 2005 23:44:33 -0500, dt <dt@example.com> wrote:
I'm trying to create a drop-in dll that will run as a module on an
existing application with just one web.config change. However, it is
necessary to maintain state within the module. I don't think that I'm
using the events correctly.

Can I only manipulate session between AcquireState and ReleaseState
events? Does that mean in BeginRequest or EndRequest, the session is off
limits? I keep getting "not a reference," and, well, that seems to
corroborate my theory.

Can I RewritePath and intercept status codes elsewhere in the chain,
like PreRequest and PostRequest (hopefully)? Or are there restrictions?
If so, can I roll my own session using BeginRequest and EndRequest?

Is there a better way to handle the desire to RewritePaths based on
session?

Thanks,
-dt


Nov 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.