473,388 Members | 970 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.

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 1573
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...
0
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...

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.