SharePoint: Setting page title from code
To dynamically set the page title from code, you cannot just directly access this.Page.Header.Title as you would with normal asp.net. This is because in the sharepoint default.master, there is a ContentPlaceHolder control with the id "PlaceHolderPageTitle" that overrides. To overcome this, simply use the following code...
ContentPlaceHolder title = this.Page.Master.FindControl("PlaceHolderPageTitle") as ContentPlaceHolder;
title.Controls.Add(new LiteralControl("Your title to go here"));
post a comment / view comments (currently 0 comments)