473,666 Members | 2,162 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

set <title> of page

Hi,

is it possible to set the title programatically from the code behind page.

I placed a literal in the head section of the form and set its text
property.

it seemed to work bu the literal is not in the <form> section of the page.
does this matter or is there a better way to programatically/dynamically set
the title of the page.

cheers

martin.
Nov 17 '05 #1
6 1935
Q. How do I set the title of an aspx page programmaticall y?

http://authors.aspalliance.com/kenc/faq5.aspx

"Alex" <al************ **@yahoo.com> wrote in message
news:e7******** ******@TK2MSFTN GP12.phx.gbl...
Hi,

is it possible to set the title programatically from the code behind page.

I placed a literal in the head section of the form and set its text
property.

it seemed to work bu the literal is not in the <form> section of the page.
does this matter or is there a better way to programatically/dynamically set
the title of the page.

cheers

martin.

Nov 17 '05 #2
Q. How do I set the title of an aspx page programmaticall y?

http://authors.aspalliance.com/kenc/faq5.aspx

"Alex" <al************ **@yahoo.com> wrote in message
news:e7******** ******@TK2MSFTN GP12.phx.gbl...
Hi,

is it possible to set the title programatically from the code behind page.

I placed a literal in the head section of the form and set its text
property.

it seemed to work bu the literal is not in the <form> section of the page.
does this matter or is there a better way to programatically/dynamically set
the title of the page.

cheers

martin.

Nov 17 '05 #3
Hi Alex

You must change your title tag in aspx-html

<HEAD>
<title runat="server" id="title"></title>
....
</HEAD>

Then can you set "title" from codebehind.

CodeBehind C#
this.title.Inne rText = "dotnetcracks.c om";

cheers
Özgür Aytekin (MCSD .NET, MCDBA)
www.dotnetcracks.com


"Alex" <al************ **@yahoo.com> schrieb im Newsbeitrag
news:e7******** ******@TK2MSFTN GP12.phx.gbl...
Hi,

is it possible to set the title programatically from the code behind page.

I placed a literal in the head section of the form and set its text
property.

it seemed to work bu the literal is not in the <form> section of the page.
does this matter or is there a better way to programatically/dynamically set the title of the page.

cheers

martin.

Nov 17 '05 #4
Hi Alex

You must change your title tag in aspx-html

<HEAD>
<title runat="server" id="title"></title>
....
</HEAD>

Then can you set "title" from codebehind.

CodeBehind C#
this.title.Inne rText = "dotnetcracks.c om";

cheers
Özgür Aytekin (MCSD .NET, MCDBA)
www.dotnetcracks.com


"Alex" <al************ **@yahoo.com> schrieb im Newsbeitrag
news:e7******** ******@TK2MSFTN GP12.phx.gbl...
Hi,

is it possible to set the title programatically from the code behind page.

I placed a literal in the head section of the form and set its text
property.

it seemed to work bu the literal is not in the <form> section of the page.
does this matter or is there a better way to programatically/dynamically set the title of the page.

cheers

martin.

Nov 17 '05 #5
this works well , but you have to watch it because when you edit the page in
the IDE it will strip the runat="server" out of the title tage :(
"Özgür Aytekin" <oa**@hotmail.c om> wrote in message
news:uX******** ******@tk2msftn gp13.phx.gbl...
Hi Alex

You must change your title tag in aspx-html

<HEAD>
<title runat="server" id="title"></title>
...
</HEAD>

Then can you set "title" from codebehind.

CodeBehind C#
this.title.Inne rText = "dotnetcracks.c om";

cheers
Özgür Aytekin (MCSD .NET, MCDBA)
www.dotnetcracks.com


"Alex" <al************ **@yahoo.com> schrieb im Newsbeitrag
news:e7******** ******@TK2MSFTN GP12.phx.gbl...
Hi,

is it possible to set the title programatically from the code behind page.
I placed a literal in the head section of the form and set its text
property.

it seemed to work bu the literal is not in the <form> section of the page. does this matter or is there a better way to programatically/dynamically

set
the title of the page.

cheers

martin.


Nov 17 '05 #6
this works well , but you have to watch it because when you edit the page in
the IDE it will strip the runat="server" out of the title tage :(
"Özgür Aytekin" <oa**@hotmail.c om> wrote in message
news:uX******** ******@tk2msftn gp13.phx.gbl...
Hi Alex

You must change your title tag in aspx-html

<HEAD>
<title runat="server" id="title"></title>
...
</HEAD>

Then can you set "title" from codebehind.

CodeBehind C#
this.title.Inne rText = "dotnetcracks.c om";

cheers
Özgür Aytekin (MCSD .NET, MCDBA)
www.dotnetcracks.com


"Alex" <al************ **@yahoo.com> schrieb im Newsbeitrag
news:e7******** ******@TK2MSFTN GP12.phx.gbl...
Hi,

is it possible to set the title programatically from the code behind page.
I placed a literal in the head section of the form and set its text
property.

it seemed to work bu the literal is not in the <form> section of the page. does this matter or is there a better way to programatically/dynamically

set
the title of the page.

cheers

martin.


Nov 17 '05 #7

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

Similar topics

13
15006
by: mark | last post by:
IF I have something like this: <title><?php print($pagetitle); ?></title> <body> <?php include("folders/my_include.php"); ?> </body> </html> and my_include.php contains the value to the variable ($pagetitle). How do I get the value before the code for the <title> is written. This is just a
5
4139
by: Info 3000 | last post by:
Hi there, Simple question, but headache ! I have a PHP Page like : <HTML> <HEAD> <TITLE>Sunny day !</TITLE> </HEAD>
3
10102
by: D. Alvarado | last post by:
Hello, I am trying to find the <TITLE> element of my document. Normally alert(document.title); works just fine, but when this statement is within a page that is a frame in a larger document, the above call always returns the title of the parent (container) page. Is it possible through JS to deduce the <TITLE> element of the current page, even if that page is a frame?
1
1397
by: Andreas Klemt | last post by:
Hello, I have in my strHtml a html page. so what is the fastest way (with XML Read?) to get the "myValue" between <title>myValue</title> Thanks, Andreas
8
3961
by: DC | last post by:
In HTML page, I put: <html> <head> <title>Article: <asp:Label ID="lblHTMLTitle"></asp:Label> </title> .... In the code behind: ....
1
1198
by: Carlo Marchesoni | last post by:
Some days ago I asked this forum whether it is possible to set up the <title> from the code-behind. A couple of poeple helped me and in fact it is quite ease: a) change the HTML, e.g.: <title id="titAV0010" runat="server"></title> b) define the field as GenericControl: protected System.Web.UI.HtmlControls.HtmlGenericControl titAV0010; c) change modifying the innerText property: titAV0010.InnerText = rm.GetString("AV0010.Title"); This...
1
1864
by: Alan Silver | last post by:
Hello, I am just experimenting with master pages, and am trying to add a content placeholder in the <head> section, so that individual pages can set their own page title and meta tags. The master page looks like this... <%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>
4
3826
by: David Thielen | last post by:
Hi; If I am using master pages, how do I set the <title> and <meta name='description' content='my title'> for each page. Obviously each page will have a different title & description. -- thanks - dave david_at_windward_dot_net http://www.windwardreports.com
15
1909
by: Steve B | last post by:
Is there a way to manipulate the <TITLEin the csharp code?
0
8356
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
8869
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
8781
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
8551
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
7386
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...
1
6198
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4198
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4368
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2011
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.