Cache.Insert ASP.NET问题 [英] Cache.Insert ASP.NET problem
本文介绍了Cache.Insert ASP.NET问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在Cache对象中插入值时,我遇到了一个奇怪的问题。我需要在ASP.Net项目中的Cache中存储两个键/值对(注意:相同的键和值)。我正在做类似跟随的事情。我能够稍后访问第一个值,但第二个值在指定的到期时间内似乎总是为NULL。我错过了什么或做错了什么?
缓存。插入( i67yoiuuy87, i67yoiuuy87 ,Nothing, DateTime .Now.AddSeconds( 100 ),Cache.NoSlidingExpiration)
Cache。插入( 783492384, 783492384,Nothing, DateTime .Now.AddSeconds( 100 ),Cache.NoSlidingExpiration)
解决方案
< blockquote>请忽略。我自己修好了。上面的代码没有问题。我在网站的另一部分中犯了一个错误,影响了这些价值。
I am facing a strange problem while inserting values in Cache object. I am needed to store two key/value pair (note: same key and value) in Cache in a ASP.Net project. And I am doing something like following. I am able to access the first value later but the second value always seems to be NULL within the specified expiration time. What am I missing or doing wrong?
Cache.Insert("i67yoiuuy87", "i67yoiuuy87", Nothing, DateTime.Now.AddSeconds(100), Cache.NoSlidingExpiration)
Cache.Insert("783492384", "783492384", Nothing, DateTime.Now.AddSeconds(100), Cache.NoSlidingExpiration)
解决方案
Please ignore. I fixed it myself. There is no problems in the above code. There was a mistake that I made in another part of the website that affected the values.
这篇关于Cache.Insert ASP.NET问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文