posts - 218, comments - 222, trackbacks - 68

My Links

News




I am a Microsoft Certified Application Developer MCAD Chartered Member (C# .Net) and born in Bangladesh.
I work for Ocean Informatics Pty Ltd as a Senior Developer - Analyst.
I am also co-founder and core developer of Pageflakes (acquired by LiveUniverse) www.pageflakes.com
and most recently created SmartCodeGenerator

My Articles
Flexible and Plugin based .Net Application..
Mass Emailing Functionality with C#, .NET 2.0, and Microsoft® SQL Server 2005 Service Broker'
Write your own Code Generator or Template Engine in .NET
Smart Code Generator .NET: Usage Overview
Smart Code Generator .NET: Architectural Overview
Smart Code Generator .NET: using with NAnt and Cassini

Archives

Free Programming Language Training

Dynamically changing the Title of Asp.Net Pages

Dynamically changing the Title of Asp.Net Pages:

<HTML>
<HEAD>
<asp:PlaceHolder id="titlePlaceHolder" runat="server" />
</HEAD> <BODY>
...
...
...
</BODY></HTML>

In the codebehind

protected PlaceHolder titlePlaceHolder;

private void Page_Load(object sender, System.EventArgs e)
{
System.Web.UI.HtmlControls.HtmlGenericControl PageTitle= new System.Web.UI.HtmlControls.HtmlGenericControl("title");
titlePlaceHolder.Controls.Add(PageTitle);
PageTitle.InnerHtml="The Title You Want";

}

Print | posted on Thursday, December 15, 2005 9:05 PM |

Feedback

Gravatar

# re: Dynamically changing the Title of Asp.Net Pages

You could also do:

<title runat=server id=theTitle />

Then declare the title as a HTMLGenericControl in the code behind.

theTitle.innerHTML = "My New Title";
12/16/2005 1:00 AM | Kyle
Gravatar

# re: Dynamically changing the Title of Asp.Net Pages

In ASP.NET 2.0, this is simplified to

Page.Title = "whatever";

in the code behind.
12/16/2005 2:35 AM | mskoolaid

Post Comment

Title  
Name  
Email
Url
Comment   
Please add 3 and 8 and type the answer here:

Powered by: