dynamic page title

  • Thread starter Thread starter Mark
  • Start date Start date
M

Mark

I'm interested in displaying a dynamic page title, rather than the static
html <title>My Page</title>. In a previous posting, I had seen a suggestion
of making the title into a server control using syntax like:


<TITLE id="objTitle" runat="server" />

However, this works for a while, but VS.NET always eventually removes the
runat attribute, and my code bombs. One reason might be that it isn't
included in the <form> tag?? Can the form tag be moved to begin above the
header?? Any suggestions?

Thanks in advance.

Mark
 
I thought that bug that removes runat="server" had been fixed. Are you using
the latest service pack for VS.NET?
 
I am using Microsoft .NET Framework 1.1, Version 1.1.4322 SP1, with VS.NET
2003 Enterprise Architect. (Version 7.1.3088)

Any other ideas?

Thanks in advance.

Mark
 
The other technique is not to use runat=server but embed the title text as a
variable:

<TITLE><% =SomeVariable %></TITLE>

where you have

protected string SomeVariable in your codebehind class.


Ken
 
Mark, I've got the exact same problem with the runat disappearing from the
title tag. I'm at dev environment 7.1.3088--I'm going to check on Ken's
suggestion that there's a newer version with a fix. In the meantime, the
literal control works fine. Also, the disappearing runat= is very
predictable: the second you switch from code view to design view it goes away
in most cases, so I've just gotten in the habit of copying it back in there
after I've done design work.

Bill
 
Back
Top