Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Changing the pages title

Reply
Thread Tools

Changing the pages title

 
 
Michael Groeger
Guest
Posts: n/a
 
      01-11-2006
Hi all,

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

Regards,
Michael


 
Reply With Quote
 
 
 
 
Lau Lei Cheong
Guest
Posts: n/a
 
      01-11-2006
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.

"Michael Groeger" <> ¼¶¼g©ó¶l¥ó·s»D: l...
> Hi all,
>
> is there a way to change the title of a page dynamically from code-behind?
>
> Regards,
> Michael
>
>



 
Reply With Quote
 
 
 
 
Karl Seguin [MVP]
Guest
Posts: n/a
 
      01-11-2006
I use
<title runat="server" id="title" />

protected HtmlGenericControl title;

title.InnerText = "whatever";

Karl
--
http://www.openmymind.net/



"Lau Lei Cheong" <> wrote in message
news:...
>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.
>
> "Michael Groeger" <>
> ¼¶¼g©ó¶l¥ó·s»D: l...
>> Hi all,
>>
>> is there a way to change the title of a page dynamically from
>> code-behind?
>>
>> Regards,
>> Michael
>>
>>

>
>



 
Reply With Quote
 
Lau Lei Cheong
Guest
Posts: n/a
 
      01-12-2006
Oops. I thought the HtmlGenericControl only affects tags in <body>.

Have learnt new thing now...

"Karl Seguin [MVP]" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME
net> ¼¶¼g©ó¶l¥ó·s»D: l...
>I use
> <title runat="server" id="title" />
>
> protected HtmlGenericControl title;
>
> title.InnerText = "whatever";
>
> Karl
> --
> http://www.openmymind.net/
>
>
>
> "Lau Lei Cheong" <> wrote in message
> news:...
>>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.
>>
>> "Michael Groeger" <> ¼¶¼g©ó¶l¥ó·s»D: l...
>>> Hi all,
>>>
>>> is there a way to change the title of a page dynamically from
>>> code-behind?
>>>
>>> Regards,
>>> Michael
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
I'm looking for html cleaner. Example : convert <h1><span><font>my title</font></span></h1> => <h1>my title</h1>… Stéphane Klein Python 2 03-30-2010 12:35 AM
Friendly Urls with page title in (eg. page-title.aspx) anthonykallay@googlemail.com ASP .Net 1 04-24-2007 08:25 AM
How 2 place page title into window title using sitemap in master page? bednar.tomas@gmail.com ASP .Net 0 11-30-2006 03:17 PM
Does anyone know the title of the first ever DVD title released? (UK/US) Mikey DVD Video 12 09-23-2006 07:14 PM
Fastest way to get a the string between <title> </title> Andreas Klemt ASP .Net 1 08-10-2003 01:58 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57