C# 不允许使用enableOutputCache参数
我正试图阻止IE缓存我的网页。 在阅读了这里的一些问题后,我发现有两种解决方案: 添加C# 不允许使用enableOutputCache参数,c#,asp.net-mvc,caching,C#,Asp.net Mvc,Caching,我正试图阻止IE缓存我的网页。 在阅读了这里的一些问题后,我发现有两种解决方案: 添加 [OutputCache(Duration = 0)] 连接到每个控制器 或者将其添加到web.config <caching> <outputCache enableOutputCache="false" /> </caching> 我决定走第二条路。 将其放入我的配置文件后: <system.web> <compilation d
[OutputCache(Duration = 0)]
连接到每个控制器
或者将其添加到web.config
<caching>
<outputCache enableOutputCache="false" />
</caching>
我决定走第二条路。
将其放入我的配置文件后:
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
<authentication mode="Windows" />
<authorization>
<deny users="?" />
</authorization>
<customErrors mode="Off" />
<caching>
<outputCacheSettings enableOutputCache="false" />
</caching>
</system.web>
enableOutputCache参数表带有下划线,并显示以下消息:“不允许使用enableOutputCache参数”
我的代码怎么了?我认为是语法错误 这应该是:
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
<authentication mode="Windows" />
<authorization>
<deny users="?" />
</authorization>
<customErrors mode="Off" />
<caching>
<outputCache enableOutputCache="false" />
</caching>
</system.web>