Reference To Instantiating Object

  • Thread starter Microsoft Newsserver
  • Start date
M

Microsoft Newsserver

I am instantiating an object in a page. From this object I want to be able
to access Session. I dont want to change the constructor to pass the page
reference to it, and I dont want to have to add extra properties.

How can I get a reference to the page in which the object is instantiated.

Cheers
 
M

Microsoft Newsserver

yeah,

I realised I could add the System.web reference to the class library and get
that.

Thanks.

Eliyahu Goldin said:
You don't need a page reference to access the session. Get it as
HttpContext.Current.Session.

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net


Microsoft Newsserver said:
I am instantiating an object in a page. From this object I want to be able
to access Session. I dont want to change the constructor to pass the page
reference to it, and I dont want to have to add extra properties.

How can I get a reference to the page in which the object is
instantiated.

Cheers
 

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

Top