Get the Session from within a static method ?

S

Sagaert Johan

Hi

How do i get the session object from within a static method ?
The system seems to call this method when binding to the objectdatasource.

I have a dataobject class with the dataobject attributte set.
[DataObjectMethod(DataObjectMethodType.Select, false)]
public ICollection<CartOrderLine> GetCart()

{

....

how do i get the session object here ?

....

}



johan
 
A

Anthony Jones

Sagaert Johan said:
Hi

How do i get the session object from within a static method ?
The system seems to call this method when binding to the objectdatasource.

I have a dataobject class with the dataobject attributte set.
[DataObjectMethod(DataObjectMethodType.Select, false)]
public ICollection<CartOrderLine> GetCart()

{

...

how do i get the session object here ?

...

}

using System.Web;

HttpSessionState sess = HttpContext.Current.Session
 
B

bruce barker

tying your business object to asp.net session is really, really poor design.
create an adapter to move data to/from session to the business object.

-- bruce (sqlwork.com)
 

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,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top