Specify page title from code-behind

Brendan McKenzie asked on July 15, 2014 09:09

I can specify the page title for a page from the Metadata tab. But on certain pages I want to be able to override this from my Page_Load function.

Is this possible? If so, how?

Correct Answer

Brendan McKenzie answered on July 15, 2014 09:11

No sooner that I ask I find the answer.

I can set the page title in an overriden OnPreRender function and it works.

protected override void OnPreRender(EventArgs e)
{
    base.OnPreRender(e);

    Page.Title = "Test";
}
2 votesVote for this answer Unmark Correct answer

Recent Answers


Brenden Kehren answered on July 15, 2014 13:29

You can also set the metadata with macros from within the UI.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.