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

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
 
J

John Saunders

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,563
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top