关于生成静态页面的问题!!!!
我的首页里有一个用户控件,用于用户登陆的,登陆成功后就显示“欢迎***”
但是我下面这个静态页面生成的办法,就出现了一个问题:
无论那个用户网站首页都显示同一个"欢迎***" ,即是匿名用户也一样!!!!!
求求那位大哥能帮忙解决一下,能不能让用于登陆的用户控件,不参与静态页面生成
具体问题显示,请看www.yongton.com
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
string Path = Server.MapPath("staticindex.htm");
if (System.IO.File.Exists(Path))
{
if (System.IO.File.GetCreationTime(Path).CompareTo(DateTime.Now.AddMinutes(-10)) < 0)
{
System.IO.File.Delete(Path);
}
else
{
Response.Redirect("staticindex.htm");
}
}
}
}
protected override void Render(HtmlTextWriter writer)
{
string StaticFileName = "staticindex.htm";
StreamWriter r = new StreamWriter(Server.MapPath(StaticFileName), false, System.Text.Encoding.UTF8);
HtmlTextWriter h = new HtmlTextWriter(r);
base.Render(h);
r.Close();
h.Close();
Response.Redirect(StaticFileName);
}