당신은에 있습니다
0 - 매개 변수
<%@ OutputCache Duration="300" VaryByParam="*" Shared="True" VaryByCustom="x" VaryByControl="hdnButtonToForceUpdateCacheIfYouWantOnClick" %>
추가 1 - SPHttpApplication, IVaryByCustomHandler을 확장합니다. https://msdn.microsoft.com/en-us/library/office/ms550239(v=office.14).aspx
: -
public class MyCache: SPHttpApplication, IVaryByCustomHandler {
public override void Init()
{
base.Init();
this.RegisterGetVaryByCustomStringHandler((Microsoft.SharePoint.ApplicationRuntime.IVaryByCustomHandler)this);
}
public string GetVaryByCustomString(HttpApplication app, HttpContext context, string custom)
{
StringBuilder sb = new StringBuilder();
string[] strings = custom.Split(';');
bool appended = false;
foreach (string str in strings)
{
switch (str)
{
case "x":
var xv= context.Request.Cookies.Get("x");
if (xv!= null)
{
sb.Append(xv.Value);
}
break;
}
}
return sb.toString();
}
}
이 후 수정하여 Global.asax에,
<%@ Assembly Name="Microsoft.SharePoint"%>
<%@ Assembly Name="Energisa.Distribuidora.Webparts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=e2d241931dc35e9d"%>
<%@ Import Namespace="(Namespace).Webparts" %>
<%@ Application Language="C#" Inherits="(Namespace).MyCache" %>
은 더보기