日期:2014-05-17 浏览次数:20418 次
public override string GetVaryByCustomString(HttpContext context, string arg)
{
string key = string.Empty;
//arg = arg.ToLower(); //outputcache customer
//if (arg.Contains("UserName")) //Login User
//{
// key += "UserName:" + HttpContext.Current.User.Identity.Name + ";";
//}
// if (arg.Contains("admin")) // Is Admin User
//{ key += "admin:" + HttpContext.Current.User.Identity.Name + ";-"; }
//return key;
if (arg.Contains("UserName")) //Is UserName List
{
HttpCookie cookie = Request.Cookies["UserName"];
if (cookie != null)
return cookie.Value;
}
return base.GetVaryByCustomString(context,arg);
}