about the duwamish 7.0

K

Kylin

In PageBase.cs file,

private const String KEY_CACHECART = "Cache:ShoppingCart:";
..
..
..
..


Cart returnValue = (Cart)(Session[KEY_CACHECART]);


meaning ?
any help or document about this ?
 
G

Gabriel Lozano-Morán

This means that the object stored in the session key "Cach:ShoppingCart:" is
explicitly casted to an object of type Cart.

Gabriel Lozano-Morán
 
S

singh_angrez

Hi,

The code is just storing the value of Cart object in the session
provided by asp.net
Now when you store the value in the session you need a key with which
you can identify it uniquely.
Also when you get the value from the session it is of "Object" type
which you have to cast into the object with which you stored that in
the session.

So while storing the value, the code should look like:

Session[KEY_CACHECART] = objCart;

where objCart is object of Cart type. So while retrieving it being cast
back to Cart
HTH,
Regards,
Angrez
 
G

Gabriel Lozano-Morán

"Cache:ShoppingCart:" is just a name they give the key. It could have been
Cache_ShoppingCart_ or CacheShoppingCart or whatever. But I assume that the
name is a concatenation of strings.

Gabriel Lozano-Morán
Software Engineer
Sogeti
 
T

TDAVISJR

Ok..I see why you are so confused. You don't know what a cache is and how
is it used in asp.net. Take a look at this:

http://www.dotnetjunkies.com/quickstart/aspplus/doc/cachingoverview.aspx

--
TDAVISJR
aka - Tampa.NET Koder


Kylin said:
Session,and the cach ..?
Put the session's value into cach ?


Hi,

The code is just storing the value of Cart object in the session
provided by asp.net
Now when you store the value in the session you need a key with which
you can identify it uniquely.
Also when you get the value from the session it is of "Object" type
which you have to cast into the object with which you stored that in
the session.

So while storing the value, the code should look like:

Session[KEY_CACHECART] = objCart;

where objCart is object of Cart type. So while retrieving it being cast
back to Cart
HTH,
Regards,
Angrez
 

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
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top