473,386 Members | 1,706 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,386 software developers and data experts.

VS2003 removing "Runat" attribute from <title>

I'm placing a runat=server attribute on the <title> tag in my pages, so I
can read/set the title text in code. The problem is that when I
subsequently change the page in design view VS is removing the runat=server
from the <title> tag. Unfortunately it does not do it all the time...maybe
50%.
Brad
Nov 18 '05 #1
7 1572
I think that is just something it does unfortunately. You would either have
to keep fixing it, or keep the page in HTML view.

"Brad" <no****@co.lane.or.us> wrote in message
news:uX**************@TK2MSFTNGP11.phx.gbl...
I'm placing a runat=server attribute on the <title> tag in my pages, so I can read/set the title text in code. The problem is that when I
subsequently change the page in design view VS is removing the runat=server from the <title> tag. Unfortunately it does not do it all the time...maybe 50%.
Brad

Nov 18 '05 #2
Yes this is a known issue:
http://groups.google.com/groups?hl=e...3DN%26tab%3Dwg

See here for gory details:
http://weblogs.asp.net/mikhailarkhip...16/132886.aspx

Apparently, this is better (fixed?) in Whidbey.

--
Hope this helps,
Bryant Hankins
Numinet Systems Inc.
http://www.numinet.com

"Brad" <no****@co.lane.or.us> wrote in message
news:uX**************@TK2MSFTNGP11.phx.gbl...
I'm placing a runat=server attribute on the <title> tag in my pages, so I can read/set the title text in code. The problem is that when I
subsequently change the page in design view VS is removing the runat=server from the <title> tag. Unfortunately it does not do it all the time...maybe 50%.
Brad

Nov 18 '05 #3
Hi,
set the runat="server" on the <head> tag and set the Title attribute as you
wish.

--
Yours sincerely,
Jacob Munk-Stander | http://jacob.munk-stander.dk
"Brad" <no****@co.lane.or.us> wrote in message
news:uX**************@TK2MSFTNGP11.phx.gbl...
I'm placing a runat=server attribute on the <title> tag in my pages, so I can read/set the title text in code. The problem is that when I
subsequently change the page in design view VS is removing the runat=server from the <title> tag. Unfortunately it does not do it all the time...maybe 50%.
Brad

Nov 18 '05 #4
I've read about people using a placeholder instead, but I've can't seem to
figure out how to remove the <span> tags that appear in my example...
Anybody?

<title>
<asp:PlaceHolder id="ph" runat="server" />
</title>
Protected ph As WebControls.PlaceHolder

Page_Load...
Dim mylabel As New System.Web.UI.WebControls.Label
mylabel.Text = "My Title"
ph.Controls.Add(myLabel)

Greg
"Marina" <so*****@nospam.com> wrote in message
news:u%******************@TK2MSFTNGP12.phx.gbl...
I think that is just something it does unfortunately. You would either have to keep fixing it, or keep the page in HTML view.

"Brad" <no****@co.lane.or.us> wrote in message
news:uX**************@TK2MSFTNGP11.phx.gbl...
I'm placing a runat=server attribute on the <title> tag in my pages,
so I
can read/set the title text in code. The problem is that when I
subsequently change the page in design view VS is removing the

runat=server
from the <title> tag. Unfortunately it does not do it all the

time...maybe
50%.
Brad


Nov 18 '05 #5
Sorry, I was working in Whidbey where this worked like a charm.

You could add a literal control to your <title> and assign the Text value of
it as you wish:
---
<head>

<title><asp:literal runat="server" id="litTitle"></asp:literal></title>

</head>

---

void Page_Load(object sender, EventArgs e)

{

litTitle.Text = "Hello, Title!";

}
--
Yours sincerely,
Jacob Munk-Stander | http://jacob.munk-stander.dk
"Jacob Munk-Stander" <ja*******@SPAMteamgates.com> wrote in message
news:e6*************@TK2MSFTNGP10.phx.gbl...
Hi,
set the runat="server" on the <head> tag and set the Title attribute as you wish.

--
Yours sincerely,
Jacob Munk-Stander | http://jacob.munk-stander.dk
"Brad" <no****@co.lane.or.us> wrote in message
news:uX**************@TK2MSFTNGP11.phx.gbl...
I'm placing a runat=server attribute on the <title> tag in my pages,
so I
can read/set the title text in code. The problem is that when I
subsequently change the page in design view VS is removing the

runat=server
from the <title> tag. Unfortunately it does not do it all the

time...maybe
50%.
Brad


Nov 18 '05 #6
Now that's what I was thinking of!

"Jacob Munk-Stander" <ja*******@SPAMteamgates.com> wrote in message
news:e4**************@TK2MSFTNGP12.phx.gbl...
Sorry, I was working in Whidbey where this worked like a charm.

You could add a literal control to your <title> and assign the Text value of it as you wish:
---
<head>

<title><asp:literal runat="server" id="litTitle"></asp:literal></title>

</head>

---

void Page_Load(object sender, EventArgs e)

{

litTitle.Text = "Hello, Title!";

}
--
Yours sincerely,
Jacob Munk-Stander | http://jacob.munk-stander.dk
"Jacob Munk-Stander" <ja*******@SPAMteamgates.com> wrote in message
news:e6*************@TK2MSFTNGP10.phx.gbl...
Hi,
set the runat="server" on the <head> tag and set the Title attribute as

you
wish.

--
Yours sincerely,
Jacob Munk-Stander | http://jacob.munk-stander.dk
"Brad" <no****@co.lane.or.us> wrote in message
news:uX**************@TK2MSFTNGP11.phx.gbl...
I'm placing a runat=server attribute on the <title> tag in my pages,

so
I
can read/set the title text in code. The problem is that when I
subsequently change the page in design view VS is removing the

runat=server
from the <title> tag. Unfortunately it does not do it all the

time...maybe
50%.
Brad



Nov 18 '05 #7
Yep.
Happened to me too.
Real pain.

I added it to my Base class and that took care of that problem.
It is not in the designer any more.
--
Joe Fallon

"Brad" <no****@co.lane.or.us> wrote in message
news:uX**************@TK2MSFTNGP11.phx.gbl...
I'm placing a runat=server attribute on the <title> tag in my pages, so I can read/set the title text in code. The problem is that when I
subsequently change the page in design view VS is removing the runat=server from the <title> tag. Unfortunately it does not do it all the time...maybe 50%.
Brad

Nov 18 '05 #8

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

Similar topics

5
by: Sonal | last post by:
Hi I am trying to provide infrastructure for RSS feeds on my Website. I dont intend to build any news aggregators. I just want my website to be enabled for providing RSS Feeds. I am using ASP.NET...
4
by: Don Wash | last post by:
Hi All! I'm getting the following Error: No DLLs has been compiled yet and nothing in the \bin directory. So it is not the versioning problem or anything like that. And here are the...
7
by: samuelberthelot | last post by:
Hi, I have the following in my asp page: <% response.write(Header) %> where Header contains HTML markup such ass <html> <body> .... I must write the code in the aspx file and not in the...
7
by: Alex Maghen | last post by:
I have some client-side JavaScript that I want to run whenever a pulldown <SELECT> is changes on th client. I'm trying to do this as follows... <select id="MyPulldown"...
19
by: Scott M. | last post by:
Why do we need runat="server" on our <headtags?
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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.