views:

24

answers:

1

In an ASP.NET 3.5 VB web app, I successfully manage to cache an object containing several personal details such as name, address, etc. One of the items is CreditNum which I'd like to change in the cache on the fly. Is there a way to access this directly in the cache or do I have to destroy and rebuild the whole object just to change the value of objMemberDetails.CreditNum?

The cache is set using:

Public Shared Sub CacheSet(ByVal key As String, ByVal value As Object)
Dim userID As String = HttpContext.Current.User.Identity.Name
HttpContext.Current.Cache(key & "_" & userID) = value
End Sub
A: 

Besides that this answer might help; Cache is really there to help you add, read, and drop the objects that your app requires frequently.

KMan
So If I read you right, you're saying, read the object back, alter the value you want then save it back to the cache?
Craig
Yep, precisely. Refer to the link I provided, you can retrieve the reference type(which your object is) and update the object, so it will update the changes in cache'd object.
KMan