Making Objects from Custom HttpModule Available to ASPX Page or ASCX Controls?

  • Thread starter Thread starter Mike Kline
  • Start date Start date
M

Mike Kline

Hi There!

How do I make the Objects in the custom made HttpModule available to ASPX
page or ASCX controls without requiring an object reference?

For example, SessionState HttpModule made the Session object available
throughout the ASP.NET application without needing to have a reference to
SessionState HttpModule. So how do I expose my own objects from my own
custom HttpModule available throughout the ASP.NET application?

Thank you all in advance!!!!

MK
 
Mike Kline said:
Hi There!

How do I make the Objects in the custom made HttpModule available to ASPX
page or ASCX controls without requiring an object reference?

For example, SessionState HttpModule made the Session object available
throughout the ASP.NET application without needing to have a reference to
SessionState HttpModule. So how do I expose my own objects from my own
custom HttpModule available throughout the ASP.NET application?

Actually, SessionState does not make "Session" available. "Session" is
Page.Session, which is the same as Context.Session, or
HttpContext.Current.Session.

Take a look at HttpContext.Items. It may be enough for you. If that API is
too clunky for your use, you could wrap it in some code of your own.

John Saunders
 
Back
Top