469,646 Members | 1,152 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,646 developers. It's quick & easy.

VS removing runat="server"

I try to set the page title dynamically in an aspx page, but sometimes
an error occurs due to VS removing the runat="server" attribute at its
own will...
How do I stop from doing so??

Libra Blue
Nov 18 '05 #1
3 1278
Try making your ASPX file read-only.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net

"Libra Blue" <li********@hotmail.com> wrote in message
news:7f**************************@posting.google.c om...
I try to set the page title dynamically in an aspx page, but sometimes
an error occurs due to VS removing the runat="server" attribute at its
own will...
How do I stop from doing so??

Libra Blue

Nov 18 '05 #2

"Libra Blue" <li********@hotmail.com> wrote in message
news:7f**************************@posting.google.c om...
I try to set the page title dynamically in an aspx page, but sometimes
an error occurs due to VS removing the runat="server" attribute at its
own will...
How do I stop from doing so??


Simple answer; you don't :/

Try using a LiteralControl between the <title></title>

<title><asp:Literal id="DynamicTitle" runat="server"></asp:Literal></title>

in code then use

DynamicTitle.Text = "My Dynamic Title"

HTH
Brian W
Nov 18 '05 #3
Yes but when you go to edit it VS removes it when you switch to HTML view
and back.
This was a real pain.
I moved it to my base class that my pages inherit from.
Solved that problem!
--
Joe Fallon

"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:Ob**************@TK2MSFTNGP10.phx.gbl...
Try making your ASPX file read-only.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net

"Libra Blue" <li********@hotmail.com> wrote in message
news:7f**************************@posting.google.c om...
I try to set the page title dynamically in an aspx page, but sometimes
an error occurs due to VS removing the runat="server" attribute at its
own will...
How do I stop from doing so??

Libra Blue


Nov 18 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Matt | last post: by
1 post views Thread by Matt | last post: by
2 posts views Thread by Lubomir | last post: by
6 posts views Thread by Martin Eyles | last post: by
11 posts views Thread by gunjan.mait | last post: by
19 posts views Thread by Scott M. | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.