471,089 Members | 1,115 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,089 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 1474
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 discussion thread is closed

Replies have been disabled for this discussion.

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.