代码改变世界

求助:GetVaryByCustomString()不工作

2005-07-17 17:14  无常  阅读(837)  评论(1)    收藏  举报
前段时间把DOTTEXT部署到服务器上好遇到一个奇怪的问题。

服务器和我的电脑都是win2003,在我的机子上测试时都正常的,
但在服务器上时自己的主页中文章列表却是显示别人的的,
当时就怀疑是缓存没更新,但不知原因在什么地方。
刚才加了段测试代码
 1         public override string GetVaryByCustomString(HttpContext context, string custom)
 2         {
 3             if(custom == "Blogger")
 4             {
 5                 string r = Dottext.Framework.Configuration.Config.CurrentBlog(context).Application;
 6                 System.Web.HttpContext.Current.Response.Write( string.Format("<!--{0}-->",r));
 7                 return r;
 8             }
 9             System.Web.HttpContext.Current.Response.Write( string.Format("<!--cache{0}-->",System.DateTime.Now.ToLongTimeString()));
10             return base.GetVaryByCustomString(context,custom);
11 
12         }
13 
14 

在我的电脑上测试时用到缓存的页面都能打印出“<!--/blogerName/-->”,
但在服务器上却没有任何显示,证明在服务器上GetVaryByCustomString(HttpContext context, string custom)根本同工作!

求助解决办法。