ASP.NET Cache包含解决方案路径

时间:2014-09-04 23:31:08

标签: asp.net webforms outputcache

为什么我的Cache对象包含一个包含以下内容的条目?它不应该是空的吗?如果没有,显然在Cache对象中有这个丑陋的默认值...我该如何删除它?我还没有向Cache对象添加任何内容,但它包含以下项目。

__System.Web.WebPages.Deployment__C:\Users\Danny\Documents\Visual Studio  2010\Projects\LearningAOP\WebAppCachingII\WebAppCachingII\***C:\Users\Danny\Documents\Visual Studio 2010\Projects\LearningAOP\WebAppCachingII\WebAppCachingII\

这是我的ASP.NET代码隐藏,标记有一个项目符号列表控件;

using System;
using System.Collections;
using System.Linq;
using System.Web.UI.WebControls;

namespace WebAppCachingII
{
    public partial class CachingDemo : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            foreach (DictionaryEntry cacheditem in Cache)
            {
                var concatstring = cacheditem.Key + "***" + cacheditem.Value;
                listOfCacheItems.Items.Add(new ListItem(concatstring));
            }
        }
    }
}

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CachingDemo.aspx.cs"     Inherits="WebAppCachingII.CachingDemo" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:BulletedList ID="listOfCacheItems" runat="server" />   </div>
    </form>
</body>
</html>
   
<configuration>
    <system.web>
      <compilation debug="true" targetFramework="4.5" />
      <httpRuntime targetFramework="4.5" />
      <caching>
           <outputCache enableOutputCache="false" />
      </caching> 
    </system.web>

</configuration>

0 个答案:

没有答案
相关问题