14

I am trying to do this, and it leads to result with contentlen 0

It looks like:

[OutputCache(Duration = 36000)]
public JsonResult GetFileClasses() 
{
   return this.Json(TopicConfig.FileExtensionsSettings.List)
}

Any ideas?

4

1 回答 1

16

OutputCacheAttribute您还必须指定 ,VaryByParam参数。否则你会在结果处理中得到这个异常System.Web.HttpException: The directive or the configuration settings profile must specify the 'varyByParam' attribute. 你可以尝试添加这个参数,看看它是否有效。

于 2010-01-19T14:42:11.863 回答