views:

60

answers:

1

I have a funny little situation on my hands.

I have a httpModule on my hands that I have to feed with context relative data.

That means that on the page I have to set something that the HttpModule can then react on. If possible I would like to avoid having call context data in the session.

Any bright ideas out there.

thx for the answer.

Edit: The HttpModule is working as a last minute interceptor. And my problem is that I am looking for a cleaver way of telling the HttpModule to:

  1. Intercept this call (changes dynamically, so can not be statically configured)
  2. Do some secret stuff with the data that I would like to pass to it
  3. Somehow make that action idempotent. Because it must not happen twice regardless of user actions and possible system errors.
A: 

Hi Dejan,

What do you mean you would like to avoid "having call context data in the session"?

HttpContext is different to session, in the fact that it only lasts for the duration of the request. Session as its name suggests lasts for the entire session (which might include multiple requests).

It might be a clean solution to use HttpContext as that is what it is there for.

Regards,

David

Update: Should have mentioned you can access the current context via HttpContext.Current.Items.

David Kiff
Have edited the question. And **thx** for the answer
Dejan