473,388 Members | 1,298 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

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.InnerText = 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 1157
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.InnerText = 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>document.title = 'Insert your title
here';</script>";
RegisterClientScriptBlock("changeTitle", titleScript);

HTH,

Onin

"niju" <di**************@gmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.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.InnerText = 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
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...
5
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'...
5
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...
6
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,...
7
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....
1
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...
0
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...
21
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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,...
0
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...

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.