can someone confirm my understanding about asp.net live cycle?

大城市里の小女人 提交于 2019-12-04 17:01:09

PreRender is one place where you could set the title, another -later- is PreRenderComplete:

protected void Page_Init(object sender, EventArgs e)
{
    this.PreRenderComplete += Page_PreRenderComplete;
    this.SaveStateComplete += Page_SaveStateComplete;
}

Edit: Just noticed that you can even use SaveStateComplete event, that should be latest place where you could change the title:

protected void Page_PreRenderComplete(object sender, EventArgs e)
{
    Page.Title = "late title";
}


protected void Page_SaveStateComplete(object sender, EventArgs e)
{
    Page.Title = "very late title";
}

Some additional informations about page-title in masterpages and Site Map Data:

Dynamically Setting the Page's Title in ASP.NET 2.0

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!