J
Jim Owen
I am storing all my application data in the application cache. Anytime I
have a method as part of an asp.net form, I need to access the objects in
the cache. The only way I can think of to do this is to call something like:
MyDataType LocalVar = (MyDataType)Cache["MyData"];
Which works fine, but I'm having to put that code at the top of every method
in my form that uses the cached data. It seems there must be a more elegant
way to do this. I don't think I can put it in a form-level field, because it
doesn't persist across posts, and I can't wrap the code into a static method
somewhere else because as I understand it the application cache can only be
access from forms, and not from .cs files.
Any ideas?
have a method as part of an asp.net form, I need to access the objects in
the cache. The only way I can think of to do this is to call something like:
MyDataType LocalVar = (MyDataType)Cache["MyData"];
Which works fine, but I'm having to put that code at the top of every method
in my form that uses the cached data. It seems there must be a more elegant
way to do this. I don't think I can put it in a form-level field, because it
doesn't persist across posts, and I can't wrap the code into a static method
somewhere else because as I understand it the application cache can only be
access from forms, and not from .cs files.
Any ideas?