Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

session methods inside class?? 1

Status
Not open for further replies.

Zarcom

Programmer
May 7, 2002
1,275
CA
I am sure this is pretty simple, I just can't wrap my head around it today. How do I access the session data as well as the request class from my own Data Access Layer?

using System.Web.HttpSessionState doesn't work. Any ideas?

That'l do donkey, that'l do
[bravo] Mark
If you are unsure of forum etiquette check here faq796-2540
 
It depends what you mean by "data access layer"

Are we talking just a few classes in your asp.net project that act as the data access layer, or did you write an entirely new assembly that just gets referenced by your project? (wait...but if its referenced, then it should be able to access it as well anyway...hmmm)

D
 
It's just a few classes within a single .cs file

That'l do donkey, that'l do
[bravo] Mark
If you are unsure of forum etiquette check here faq796-2540
 
Try adding

Inherits System.Web.UI.page

to your class

D
 
Thanks Jack. I got a question though. It just seems to be kinda a hack to me. Do you know of any performance hits that I'll take by adding page inheritance to the classes?

That'l do donkey, that'l do
[bravo] Mark
If you are unsure of forum etiquette check here faq796-2540
 
I guess in a way it is a hack, since technically only web pages should have access to a session variable (you could take your data tier code and plunk it down into a vb.net windows app, and it would run as well, but you wouldn't need session vars there and they wouldn't be available).

Not sure about what the performance hit would be, or if there would be one that would impact your app in any noticable way.

Of course, the alternative is to pass the session values in through another means, instead of having the data tier resort to grabbing the values from session.

But I think that would mean more coding in the long run for you, right? I think from an architecture perspective, its probably better not to access the session vars from the data tier, but it all depends on the contraints of time on your project I guess.

D'Arcy
 
Well since I don't know that I am getting paid for it anymore, none of it really matters does it?

Thanks for the help anywho

That'l do donkey, that'l do
[bravo] Mark
If you are unsure of forum etiquette check here faq796-2540
 
Well go and put a downer on the whole thread then!

And its HOO, anyHOO! (do we have to start this debate again?)
;)

D
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top