473,665 Members | 2,827 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

dynamic page title

I'm interested in displaying a dynamic page title, rather than the static
html <title>My Page</title>. In a previous posting, I had seen a suggestion
of making the title into a server control using syntax like:
<TITLE id="objTitle" runat="server" />

However, this works for a while, but VS.NET always eventually removes the
runat attribute, and my code bombs. One reason might be that it isn't
included in the <form> tag?? Can the form tag be moved to begin above the
header?? Any suggestions?

Thanks in advance.

Mark
Nov 18 '05 #1
5 3612
I thought that bug that removes runat="server" had been fixed. Are you using
the latest service pack for VS.NET?

"Mark" wrote:
I'm interested in displaying a dynamic page title, rather than the static
html <title>My Page</title>. In a previous posting, I had seen a suggestion
of making the title into a server control using syntax like:
<TITLE id="objTitle" runat="server" />

However, this works for a while, but VS.NET always eventually removes the
runat attribute, and my code bombs. One reason might be that it isn't
included in the <form> tag?? Can the form tag be moved to begin above the
header?? Any suggestions?

Thanks in advance.

Mark

Nov 18 '05 #2
I am using Microsoft .NET Framework 1.1, Version 1.1.4322 SP1, with VS.NET
2003 Enterprise Architect. (Version 7.1.3088)

Any other ideas?

Thanks in advance.

Mark

"Ken Cox [Microsoft MVP]" <BA************ @sympatico.ca> wrote in message
news:3B******** *************** ***********@mic rosoft.com...
I thought that bug that removes runat="server" had been fixed. Are you using the latest service pack for VS.NET?

"Mark" wrote:
I'm interested in displaying a dynamic page title, rather than the static html <title>My Page</title>. In a previous posting, I had seen a suggestion of making the title into a server control using syntax like:
<TITLE id="objTitle" runat="server" />

However, this works for a while, but VS.NET always eventually removes the runat attribute, and my code bombs. One reason might be that it isn't
included in the <form> tag?? Can the form tag be moved to begin above the header?? Any suggestions?

Thanks in advance.

Mark

Nov 18 '05 #3
The other technique is not to use runat=server but embed the title text as a
variable:

<TITLE><% =SomeVariable %></TITLE>

where you have

protected string SomeVariable in your codebehind class.
Ken
"Mark" wrote:
I am using Microsoft .NET Framework 1.1, Version 1.1.4322 SP1, with VS.NET
2003 Enterprise Architect. (Version 7.1.3088)

Any other ideas?

Thanks in advance.

Mark

"Ken Cox [Microsoft MVP]" <BA************ @sympatico.ca> wrote in message
news:3B******** *************** ***********@mic rosoft.com...
I thought that bug that removes runat="server" had been fixed. Are you

using
the latest service pack for VS.NET?

"Mark" wrote:
I'm interested in displaying a dynamic page title, rather than the static html <title>My Page</title>. In a previous posting, I had seen a suggestion of making the title into a server control using syntax like:
<TITLE id="objTitle" runat="server" />

However, this works for a while, but VS.NET always eventually removes the runat attribute, and my code bombs. One reason might be that it isn't
included in the <form> tag?? Can the form tag be moved to begin above the header?? Any suggestions?

Thanks in advance.

Mark


Nov 18 '05 #4
What I recommend, in a totally ASP.Net solution, is to put a literal inside
the TITLE tags....then, programmaticall y change the text property of the
literal
Check out:
http://aspnet101.com/titlechange.asp...tlechange.aspx

David Wier
MCP, MVP ASP.NET, ASPInsider
http://aspnet101.com
http://aspexpress.com
"Mark" <mf****@idonotl ikespam.cce.umn .edu> wrote in message
news:ud******** ******@TK2MSFTN GP10.phx.gbl...
I'm interested in displaying a dynamic page title, rather than the static
html <title>My Page</title>. In a previous posting, I had seen a suggestion of making the title into a server control using syntax like:
<TITLE id="objTitle" runat="server" />

However, this works for a while, but VS.NET always eventually removes the
runat attribute, and my code bombs. One reason might be that it isn't
included in the <form> tag?? Can the form tag be moved to begin above the
header?? Any suggestions?

Thanks in advance.

Mark

Nov 18 '05 #5
Mark, I've got the exact same problem with the runat disappearing from the
title tag. I'm at dev environment 7.1.3088--I'm going to check on Ken's
suggestion that there's a newer version with a fix. In the meantime, the
literal control works fine. Also, the disappearing runat= is very
predictable: the second you switch from code view to design view it goes away
in most cases, so I've just gotten in the habit of copying it back in there
after I've done design work.

Bill

"Mark" wrote:
I'm interested in displaying a dynamic page title, rather than the static
html <title>My Page</title>. In a previous posting, I had seen a suggestion
of making the title into a server control using syntax like:
<TITLE id="objTitle" runat="server" />

However, this works for a while, but VS.NET always eventually removes the
runat attribute, and my code bombs. One reason might be that it isn't
included in the <form> tag?? Can the form tag be moved to begin above the
header?? Any suggestions?

Thanks in advance.

Mark

Nov 18 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
6535
by: Litron | last post by:
This question borders between HTML and JS. I would like to have one ALT tag for a Button (IMG src link) when the user creates an onMouseOver event and a second Alt tag displayed onMouseOver if that page is already current in the browser. Can I assign the ALT tag text to a global variable and change the value of the global variable when certain conditions exist, therefore having the ALT Tag display dynamic messages...?
6
7388
by: 35th Ave Media | last post by:
Hello, I have about 60+ pages that I need to insert a MAILTO: tag so people can email the page using their email client. The body of the message is going to be the URL of that page. Using ASP, how can I insert the page URL in the email body without having to manually enter each URL for each MAILTO: tag? Is there a variable that can be used inside the MAILTO: tag that automatically inserts the current page's URL into the body of the...
7
1884
by: Abraham Luna | last post by:
how do i stop the dynamic validators from breaking explorer if i use a dynamic validator and move to a different control it breaks explorer and i can type in the page when i'm not supposed to. thank you.
2
2704
by: WolfyUK | last post by:
Hello, I have a standard asp:DataGrid called CasesGrid that I wish to write my own paging controls for. The aim is to get something like the following rendered to screen: << First < Previous 1 2 3 4 5 ... Next Last >> I have achieved the first/previous/next/last buttons quite easily as follows in the ASPX (1.1) page:
7
4265
by: Bertman105 | last post by:
Hey all, Heres the situation: I have a form page that needs to have multiple drop down menus that is pulling their options from a database. Right now I have one working out of 3. So that is one issue, now the issue that I am having with the one that is working, is that it is not writing anything to the database. No matter what you select, the database is empty. Any help would be sweet. So here is the form page, with just a few text...
2
3349
by: thetechturf.com | last post by:
I have some simple dynamic content pages (included below). I need to know how to add specific meta tags (ie. description, keywords, ect.), as well as extra specific header coding to a page. I would like to have these on the Links page. Is this possible? and how? ------------------------------------------------------------------------------------------------------------------------------ index.php --------------- <?php // Assign the...
6
2829
by: Harshpandya | last post by:
HI all, I am working on the Ajax and PHP to make dynamic web page application I have HTML page - in which i am calling two different pages Google and NBC from Drop down menu. OUTPUT WANTED: I want the google page displayed under display message on the same page when i select google. and when i select NBC news - i want the NBC news page to be displayed under the display message on same page.
21
7682
by: karen987 | last post by:
I have a news website, with asp pages. It has publishing software which allows you to add articles in a database, and then calls them up from links etc. I have added dynamic meta tags in 2 parts. The first part is in the inc.header.asp file which is called up on every page. The page itself has the meta tag variable, ie. title, description. They work fine on all pages, except the one below i'm having problems with. Ironically it's the most...
0
8348
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8863
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8779
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8549
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8636
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7376
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4356
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2004
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1761
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.