473,795 Members | 2,980 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dynamic Title

Hi there,
I am dynamically populating title for my web page. Here is the code
<title id="titleLabel " runat="server"> </title>

Code behind
-----------
titleLabel.Inne rText = myArrayList[1].ToString();

However, after compiling the page few times runat="server" disappears
and my page doesn't compile. When this happens this is what code
looks like

<title id="titleLabel " ></title>

How can I resolve this problem?
Many thanks
Niju

Nov 19 '05 #1
2 1174
I'm assuming your using Visual C#?

This problem is related to the dissapearing OnInit code that occurs with
Visual C#. I had the same problem ages ago. Basically, I was told by MS that
there was a DLL problem (not one of their DLLs they were quick to point out)
that was deleting code. It's to do with the designer view.

The fix they gave me was to stop using designer view, and to change some
options. Set things like "open web pages in html view" and things like that.

Most annoying, but they assured me they wouldn't be writing a fix, so I've
been without design view for 9months. Everything is fixed in VS2005 though,
apparently.

Good luck!
Dan

"niju" wrote:
Hi there,
I am dynamically populating title for my web page. Here is the code
<title id="titleLabel " runat="server"> </title>

Code behind
-----------
titleLabel.Inne rText = myArrayList[1].ToString();

However, after compiling the page few times runat="server" disappears
and my page doesn't compile. When this happens this is what code
looks like

<title id="titleLabel " ></title>

How can I resolve this problem?
Many thanks
Niju

Nov 19 '05 #2
You can try the code below... you won't need to declare a server side
<title> element for this code to work. Just put the code to your Page_Load
event.

string titleScript = "<script>docume nt.title = 'Insert your title
here';</script>";
RegisterClientS criptBlock("cha ngeTitle", titleScript);

HTH,

Onin

"niju" <di************ **@gmail.com> wrote in message
news:11******** **************@ o13g2000cwo.goo glegroups.com.. .
Hi there,
I am dynamically populating title for my web page. Here is the code
<title id="titleLabel " runat="server"> </title>

Code behind
-----------
titleLabel.Inne rText = myArrayList[1].ToString();

However, after compiling the page few times runat="server" disappears
and my page doesn't compile. When this happens this is what code
looks like

<title id="titleLabel " ></title>

How can I resolve this problem?
Many thanks
Niju

Nov 19 '05 #3

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

Similar topics

1
2501
by: Macamba | last post by:
Hi all, I am currently developing a website for a voluntary organisation. It is my first step in website development. The dynamic menu I developed has some bugs, which I addressed in another post. In this post I want to ask you why my code behaves differently in IE, while it behaves like I expect in Mozilla and Opera. What I would like to see addressed is what I need to do to get the same behaviour in all 3 browsers. I know each browser...
5
4397
by: Tompa | last post by:
Hi, I would like to create images on the fly as a response to an http request. I can do this with PIL like this (file create_gif.py): from PIL import Image, ImageDraw print 'Status: 200 OK' print 'Content-type: text/html' print print '<HTML><HEAD><TITLE>Python Dynamic Image Creation Test</TITLE></HEAD>'
5
3618
by: Mark | last post by:
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...
6
7404
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
1893
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.
1
8441
by: Pacific Fox | last post by:
Hi all, I have a SQL statement that allows paging and dynamic sorting of the columns, but what I can't figure out without making the SQL a dynamic string and executing it, or duplicating the SQL statement between an IF and ELSE statement. Following is the SQL statement; set ANSI_NULLS ON
0
5293
by: Eniac | last post by:
Hi, I've been working on a custom user control that needs to be modified and the validation is causing me headaches. The control used to generate a table of 4 rows x 7 columns to display all the days in the week with dates and textboxes to fill in some data. row 1: question
21
7710
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
9522
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
10448
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
10217
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...
0
10003
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
9046
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
6784
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5440
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
5566
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3730
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.