日期:2014-05-18  浏览次数:20424 次

application_start 和cache的问题
1。
在application_start中声明

application.add("str","hmily");

然后在a.aspx 中使用

string a = application["str"].ToString;

为什么会出错 说application["str"].ToString 未实例化??
已经在Globle application_start中声明 了啊!~

2。cache是公用的吗?

比如我 声明的cache 所有的用户 操作的都是一个cache么?
不象session 是对个人的?



------解决方案--------------------
HTML code
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Test.aspx.cs" Inherits="Test" %>

<%@ Register Assembly="CrystalDecisions.Web, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"
    Namespace="CrystalDecisions.Web" TagPrefix="CR" %>
<!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>
    <link href="/aspnet_client/System_Web/2_0_50727/CrystalReportWebFormViewer3/css/default.css"
        rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
        <div>
        </div>
    </form>
</body>
</html>