Groups | Blog | Home
all groups > asp.net > november 2004 >

asp.net : How do I programatically change the page title in ASP.Net


Craig Wilson
11/11/2004 11:22:40 PM
How do I programmatically change the page title in ASP.Net



In general, I need to get at the object model that gets access to the title
property.



best wishes,

cw

Steve C. Orr [MVP, MCSD]
11/12/2004 1:57:06 AM
You can set the page title through code by adding the runat="server"
attribute to your title tag.
Here's a good example:
http://www.aspalliance.com/kenc/faq5.aspx

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com


[quoted text, click to view]

Tampa .NET Koder
11/12/2004 7:27:02 AM
I did it this way before
<title><%# Title %></title>

Then, in the page load I did
Dim Title as String = "My Home Page"
Page.Databind()

And that worked from what I remembered. There is probably a few ways to do
this I think

[quoted text, click to view]
clintonG
11/12/2004 9:42:06 AM
Be advised that Visual Studio.NET 2003 will remove the runat attribute
when used with the HTML title element when switching between the design and
code view.

--
<%= Clinton Gallagher, "Twice the Results -- Half the Cost"
Architectural & e-Business Consulting -- Software Development
NET csgallagher@REMOVETHISTEXTmetromilwaukee.com
URL http://www.metromilwaukee.com/clintongallagher/



[quoted text, click to view]

AddThis Social Bookmark Button