Changing the pages title

  • Thread starter Thread starter Michael Groeger
  • Start date Start date
M

Michael Groeger

Hi all,

is there a way to change the title of a page dynamically from code-behind?

Regards,
Michael
 
I usually use <title><%= this._title %></title> to workaround. Just set the
_title(string type of course) to set the title of the page.

This works because Render() is always the last method to run to the cycle.

In .NET 2.0, you can set the Page.Title property directly.
 
I use
<title runat="server" id="title" />

protected HtmlGenericControl title;

title.InnerText = "whatever";

Karl
 
Oops. I thought the HtmlGenericControl only affects tags in <body>. :P

Have learnt new thing now...

"Karl Seguin [MVP]" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME
net> ¼¶¼g©ó¶l¥ó·s»D:[email protected]...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top