set <title> of page

  • Thread starter Thread starter Alex
  • Start date Start date
A

Alex

Hi,

is it possible to set the title programatically from the code behind page.

I placed a literal in the head section of the form and set its text
property.

it seemed to work bu the literal is not in the <form> section of the page.
does this matter or is there a better way to programatically/dynamically set
the title of the page.

cheers

martin.
 
Q. How do I set the title of an aspx page programmatically?

http://authors.aspalliance.com/kenc/faq5.aspx

Hi,

is it possible to set the title programatically from the code behind page.

I placed a literal in the head section of the form and set its text
property.

it seemed to work bu the literal is not in the <form> section of the page.
does this matter or is there a better way to programatically/dynamically set
the title of the page.

cheers

martin.
 
Hi Alex

You must change your title tag in aspx-html

<HEAD>
<title runat="server" id="title"></title>
....
</HEAD>

Then can you set "title" from codebehind.

CodeBehind C#
this.title.InnerText = "dotnetcracks.com";

cheers
Özgür Aytekin (MCSD .NET, MCDBA)
www.dotnetcracks.com
 
this works well , but you have to watch it because when you edit the page in
the IDE it will strip the runat="server" out of the title tage :(
 
Back
Top