Ask a Question related to ASP.NET General, Design and Development.
-
Natty Gur #1
Re: Accessing Application State on a Cache Expiration
Hi,
You can’t access the HttpContext.Current because when the callback
function call there isn’t any client request or to be more accurate the
callback isn’t attach to any request. To overcome it create private
member of application type in the global class and set it to the
application when the application start. Use the application private
member.
Check out my sample:
[url]http://www.developersdex.com/gurus/code/653.asp[/url]
Natty Gur, CTO
Dao2Com Ltd.
34th Elkalay st. Raanana
Israel , 43000
Phone Numbers:
Office: +972-(0)9-7740261
Fax: +972-(0)9-7740261
Mobile: +972-(0)58-888377
*** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!
Natty Gur Guest
-
Advantages of empty Application Base State?
Several examples are coded where the Main.mxml base state is empty and there is a child state called e.g. main App (start) containing the initial... -
Accessing the Memoize cache
I have an expensive function my_cmp that I'd like to Memoize. Is there any way I can take advantage of the property that my_cmp($a,$b) == -... -
How to cache Acrobat Distiller application in Windows?
Hi all, We have developed a program which will call the macro to convert MSWord doc to pdf using Acrobat 6.0. However, we found that it runs... -
Object in application state
If have an object with a variable i stored in the application state in the asp.net application. Is there a way to force this object in the... -
Application state
Is everything stored in Application or Session state boxed? For example: Application = 10; Is there boxing involved? Thanks. Just learning... -
John McDowell #2
Re: Accessing Application State on a Cache Expiration
>
Hmmm. That's kinda what I figured I'd have to do (except I have to> You can't access the HttpContext.Current because when the callback
> function call there isn't any client request or to be more accurate the
> callback isn't attach to any request. To overcome it create private
> member of application type in the global class and set it to the
> application when the application start. Use the application private
> member.
>
use a Public Static (Shared in VB) as I need to get at it from several
classes). Thanks for the info.
You don't need to go through all that for your example though. Just
use System.Web.HttpRuntime.Cache to access the Cache from anywhere,
like a callback not attached to a request in a different class.
That's why I kinda figured there's be another way to get to the
ApplicationState, since they made the Cache available.
John
John McDowell Guest



Reply With Quote

