Hi All,
This source what i have used to create cache object.Also i have checked if "AppCache_Caption" cache object is available or not.
C#
if (HttpRuntime.Cache["AppCache_Caption"] == null){HttpRuntime.Cache.Insert("AppCache_Caption", dicCache, null,System.Web.Caching.Cache.NoAbsoluteExpiration,System.Web.Caching.Cache.NoSlidingExpiration,System.Web.Caching.CacheItemPriority.Normal,null);}
Right now i have checked and created my login page page_load event. It will create cache object every time me access the login page.
What are the conditions wrong my source?
My expectation, cache object creates only one time.It will not create everytime.
Please help me
Thanks in advance
Rameshkumar.T
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Public Sub Insert ( _
key As String, _
valueAs Object, _
dependencies As CacheDependency, _
absoluteExpiration As DateTime, _
slidingExpiration As TimeSpan, _
onUpdateCallback As CacheItemUpdateCallback _
)
it is the syntax forinsertmethod i think you are wrong in third parameter you give the valueas date.now.addminute(20) or .adddays(2) like
that based on that time you cache object is alive
plz refer the microsoft site:
http://msdn.microsoft.com/en-us/library/system.web.caching.cache.insert.aspx
Ramesh Kumar43 reputationPosted Aug 7, 2010, 4:31 AM EDT
0
Hi Koti,
Thank you for your reply.
I tried same things it happened again the cache has created every run the application.
Please give sample source based on my example.
Thanks in advance.
Rameshkumar.T
Koteswararao MallisettiRank #2,740 · 511 reputationPosted Aug 6, 2010, 11:15 PM EDT
Public Sub Insert ( _ key As String, _ value As Object, _ dependencies As CacheDependency, _ absoluteExpiration As DateTime, _ slidingExpiration As TimeSpan, _ onUpdateCallback As CacheItemUpdateCallback _ ) it is the syntax for insert method i think you are wrong in third parameter you give the value as date.now.addminute(20) or .adddays(2) like that based on that time you cache object is alive plz refer the microsoft site: http://msdn.microsoft.com/en-us/library/system.web.caching.cache.insert.aspxRamesh Kumar43 reputationPosted Aug 7, 2010, 4:31 AM EDT
Thank you for your reply.
I tried same things it happened again the cache has created every run the application.
Please give sample source based on my example.
Thanks in advance.
Rameshkumar.T