Add a ID=”whatever” and a Runat=”Server”
to the Title element on the aspx page.
<title runat="server" id="pageTitle"></title>
Then, in code-behind :
protected System.Web.UI.HtmlControls.HtmlGenericControl pageTitle;
pageTitle.InnerText = "Whatever you want to place here -” + anyvariable ;
If you want to get the aspx page's name, per your followup post, use :
string pagename = System.IO.Path.GetFileName(Request.ServerVariables["SCRIPT_NAME"]);
That will return : "WhateverThePageNameIs.aspx".
You can insert that value in the "anyvariable" variable.
Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ :
http://asp.net.do/faq/
ASPNETFAQ.COM :
http://www.aspnetfaq.com/
Foros de ASP.NET en Español :
http://asp.net.do/foros/
======================================
"tshad" <ts**********@ftsolutions.com> wrote in message
news:Oo**************@TK2MSFTNGP10.phx.gbl...
Is there an easy way to get the title of the aspx page I am on?
Thanks,
Tom