posts - 234, comments - 480, trackbacks - 56

My Links

News




I am born in Bangladesh and currently live in Melbourne, Australia. I am a co-founder and core developer of Pageflakes www.pageflakes.com and CEO at Simplexhub, a highly experienced software development company based in Melbourne Australia and Dhaka, Bangladesh. Simplexhub, is on its mission to build a smart virtual community in Bangladesh and recently launched beta realestatebazaar.com.bd an ASP.NET MVC application written in C#.NET.

I also created SmartCodeGenerator

Some of 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 A Comment
Title:
Name:
Email:
Website:
Comment:
Verification:
 
 

Powered by: