Changing Page Title

  • Thread starter Thread starter chuckdfoster
  • Start date Start date
C

chuckdfoster

Can I change the page title from my ASP.NET code? I know you can from
classic ASP.

Thanks in advance.
 
I would just put the title text like this...

<head>
<title><asp:Literal id="litTitle" runat="server"
Text="GetFirefox.com"></asp:Literal></title>
</head>

I do stuff like that all the tiem, but it's because I like the level of
control I get...

Oh and VS will probably complain...no worries, it'll run.
 
Thanks for your help, but I'm a little confused.
I added <title><asp:Literal id="litTitle" runat="server"
Text="Scholarship"></asp:Literal></title> to my page header. Now how do I
change the text of the title. I have existing code that says...
If Request.Params("action") = "newscholar" Then

dgNewScholar.Visible = True

...

ElseIf Request.Params("action") = "editscholar" Then

dgEditScholar.Visible = True

...

End If

Can I add something to this or do change it in the header?

Thanks again, Chuck
 
Glad you found your solution.

Just for anyone interested, the Page class ASP.Net 2.0 exposed a Title
property for this very reason. It also exposes a very nice Header property
that let's you easily add things (like style shee links, meta tags) to the
head.

Karl
 

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

Back
Top