Get the Session from within a static method ?

  • Thread starter Thread starter Sagaert Johan
  • Start date Start date
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
 
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
 
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)
 
Back
Top