但到了ASP.Net的时代,当我还糊里糊涂地使用这条语句时,发现MSDN中对Response的这个字段的说明是:
Sets the Cache-Control HTTP header to Public or Private.
[C#]
public string CacheControl {get; set;} Property Value
"Public" or "Private".
Exceptions
ArgumentException: CacheControl is an invalid cache control value (not Private or Public). 而且经实践,这种方法的功能仍然与ASP中是一样的。当然,似乎.Net官方推荐这种方法:
Response.Cache.SetCacheability(System.Web.HttpCacheability.NoCache);最后,有一点要注意,似乎只有IE的结果是对的,Firefox不买这个帐……