crosstf
asked on
Adding a Collection to the Cache, asp.net, C#
I was wondering how i could add or insert items into a cache considering multiple ajax posts in a file upload.
This does not work:
((List<RebateImage>)Cache[ SessionID] ).Add(new RebateImage { Imagetype = imagetype, Filename = fileName, Imagefile = imagetoupload });
It works this way with a session (I can't use session due to a cms), but I am looking for this same concept if I assign a List<RebateImage> to a cache Object.
This does not work:
((List<RebateImage>)Cache[
It works this way with a session (I can't use session due to a cms), but I am looking for this same concept if I assign a List<RebateImage> to a cache Object.
Can you clarify what you mean by "does not work?"
ASKER
It doesn't seem to be adding the item to the collection. Should this syntax work?
ASKER
I suppose I should use insert correct? I am using an ajax file upload to post images and add them to a list<t> of the class that I created. I cannot use session, so I thought I would use cache and make the cache ID the sessionID so it would be unique. I need to be able to maintain the collection until a submit button is pressed for a from on another method.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
You are correct, I did do it correctly, for some reason it wouldn't register the record count on the stepthrough..
Thanks!
Thanks!