Changing the pages title

M

Michael Groeger

Hi all,

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

Regards,
Michael
 
L

Lau Lei Cheong

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.
 
K

Karl Seguin [MVP]

I use
<title runat="server" id="title" />

protected HtmlGenericControl title;

title.InnerText = "whatever";

Karl
 
L

Lau Lei Cheong

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

Members online

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top