Page Title

  • Thread starter Thread starter Jeremy
  • Start date Start date
J

Jeremy

How do I programmatically change a page title ?

Can I remove the " - Microsoft Internet Explorer" suffix IE seems to insist
on adding ?
 
...
How do I programmatically change a page title ?

In 'normal' ASP I would have done something like this

<html>
<head>
<title><%=strMyTitle<%></title>
</head>

etc
Can I remove the " - Microsoft Internet Explorer" suffix IE seems to insist
on adding ?

I think you'll find thats always added to the top bar after the page title
anyway (unless you resize the browser window so it doesnt show - but it
would still be there)..

Regards

Rob
 
I think if you place an <asp:Literal id=...
runat="server"> inside the <title> tag and set it's Text
property to whatever you want it will work even though its
really not supposed to I think(it's outside the form).. I
set my stylesheets src programmaticaly like this depending
on the browser and it works...
 
Jeremy,

To change title,
<title runat=server id=PageTitle/>
...
PageTitle.Text = "MyPageTitle";

Removing the " - Microsoft Internet Explorer" can only be done on the
client's registry AFAIK.

Alex Papadimoulis
 
Almost there ... but if I embed the literal within the page's title
property, within my c# code it is not declared as a Literal object,
therefore if I try to set it's text property it will not compile. What am I
missing ?
 
oh I see, I have to declare a Literal object manually in my c# code of the
same name, then it works.

Thanks.
 
Back
Top