posts - 236, comments - 436, trackbacks - 56

My Links

News

Awarded Microsoft MVP C#.NET - 2007, 2008 and 2009


I am born in Bangladesh and currently live in Melbourne, Australia. I am a Microsoft Certified Application Developer MCAD Chartered Member (C# .Net)and born in Bangladesh.
I am founder and Chief Executive Officer of
Simplexhub, a highly experienced software development company based in Melbourne Australia and Dhaka, Bangladesh. Co-founder and core developer of Pageflakes www.pageflakes.com.
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.


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

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";

}

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

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: