protected void Page_Load(object sender, EventArgs e)
    
{
        
if (!this.IsPostBack)
        
{
            
this.searchDescription.Content = this.SearchDescription;
            
this.searchKeywords.Content = this.SearchKeywords;
        }

        
if (SiteMap.CurrentNode != null)
        

         
this.Page.Title = SiteMap.CurrentNode.Title;
        }

        
else
        
{
            
this.Page.Title = "尚未在Web.sitemap配置此页面导航";
        }

    }

    
protected override void Render(HtmlTextWriter writer)
    
{
        
this.Page.Title = this.Page.Title + " | " + Keyss.WebFramework.ConfigManager.GetInstance().SiteName;
        
base.Render(writer);
    }


解释:
一、之所以不在(!this.IsPostBack){}块中实现页面判断是因为page.Title中无法保存视图状态,我觉得这是.net2.0中的一个小bug吧。
二、之所以在render方法重写title属性是因为在页面的生存期中,render方法不会保存viewstate,而从写page.Title内容仅在masterpage中有效是因为masterpage负责页面标题的render,在其后的page的render方法中,title已经render完毕,些时改变title并不会影响render的结果。

http://www.cnblogs.com/keyss/archive/2006/04/03/365506.html