By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,763 Members | 1,641 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,763 IT Pros & Developers. It's quick & easy.

VS removing runat="server"

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a

"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

P: n/a
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.