While using VS.NET 2003, if you create a title tag in the HTML area of an aspx page that is to be run as a server-side tag such as:
<title runat="server" id="PageTitle"></title>
And using similiar code in the code-behind:
Protected WithEvents PageTitle As System.Web.UI.HtmlControls.HtmlGenericControl
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As _ System.EventArgs) Handles MyBase.Load
PageTitle.InnerText = "Page 1"
End Sub
Randomly the IDE will REMOVE the "runat=server" from the HTML tag and then the code errors in that the tag "PageTitle" does not exists. I have seen it randomly throughout the last several projects I have been on that used this code to store the page title in the web.config file, however, this gets a little annoying in that the IDE is removing code that I explicitly put into my program
Yes, this is a known issue. Runat=server does not work on the title tag very
well, sorry.
On 6/30/04 11:39, in article
0A7E907F-67B8-4E46-BF60-E23A0A3AB553@microsoft.com, "LeoM1895"
> While using VS.NET 2003, if you create a title tag in the HTML area of an aspx
> page that is to be run as a server-side tag such as:
[quoted text clipped - 17 lines]
> little annoying in that the IDE is removing code that I explicitly put into my
> program
Martin Bischoff - 22 Jul 2004 15:48 GMT
Hi Mikhail,
unfortunately the same problem also exists with the runat="server"
attribute on head, link, etc. tags :-(
Is there any chance that this bug gets fixed by .net1.1 sp1?
---
Martin
> Yes, this is a known issue. Runat=server does not work on the title tag very
> well, sorry.
[quoted text clipped - 23 lines]
>>little annoying in that the IDE is removing code that I explicitly put into my
>>program
Mikhail Arkhipov (Microsoft) - 23 Jul 2004 05:54 GMT
Unfortunately, this issue is impossible to fix in service packs. If you want
to know gory details, have a look here
http://weblogs.asp.net/mikhailarkhipov/archive/2004/05/16/132886.aspx
Thanks
Mikhail Arkhipov (Microsoft)
-- This post is provided 'AS IS' with no warranties and confers no rights.
On 7/22/04 7:48, in article OZAxnr$bEHA.3596@tk2msftngp13.phx.gbl, "Martin
Bischoff" <nitramb@gmx.net> wrote:
> Hi Mikhail,
>
[quoted text clipped - 36 lines]
>>> my
>>> program
I have seen similar behavior with HTML in general. I must say I run across many issues with the IDE as an HTML/ASPX editor.
The VS 2003 IDE seems to remove/change the HTML code most often when formatting the HTML. I often have problems with the IDE removing varies items from complex <object> tags I use for flash movies, or inline style attributes.
I have been consistantly able to reproduce one of these issues. An HTML tag like this:
<TD style="background-image: URL(/assets/top_image.gif); background-repeat: no-repeat; background-position: right;" bgcolor="#830C12" width="100%" height="85">
is changed to:
<TD bgcolor="#830c12" width="100%" height="85">
if I select Edit | Advanced | Format Document and switch to Design mode and back to HTML mode.
Also, a construct like:
<asp:Repeater id="UWTeam" runat="server">
<HeaderTemplate> </HeaderTemplate>
<ItemTemplate>
<P>
<strong><%# DataBinder.Eval(Container.DataItem, "comment")%></strong>
<br>
<a href="mailto:<%# DataBinder.Eval(Container.DataItem, "email")%>">
<%# DataBinder.Eval(Container.DataItem, "Name")%> </a> </P>
</ItemTemplate>
<FooterTemplate> </FooterTemplate>
</asp:Repeater>
is greated with an error message like:
Could not open in design view. Quote values differently in a <%..."value"... %> block.
Should I be doing something different...? The rendered HTML is correct.
> While using VS.NET 2003, if you create a title tag in the HTML area of an aspx page that is to be run as a server-side tag such as:
>
[quoted text clipped - 9 lines]
>
> Randomly the IDE will REMOVE the "runat=server" from the HTML tag and then the code errors in that the tag "PageTitle" does not exists. I have seen it randomly throughout the last several projects I have been on that used this code to store the page title in the web.config file, however, this gets a little annoying in that the IDE is removing code that I explicitly put into my program
Mikhail Arkhipov (Microsoft) - 17 Jul 2004 23:26 GMT
Visual Studio HTML Editor does not support nested quotes of the same kind.
If you have href="<% ... " foo " %>">, change it to href='<% ... " foo "
%>'> putting single quotes outside.
Here is some more info regarding HTML changes.
http://weblogs.asp.net/mikhailarkhipov/archive/2004/05/16/132886.aspx
> Thanks
> Mikhail Arkhipov (Microsoft)
> -- This post is provided 'AS IS' with no warranties and confers no rights.
On 7/15/04 21:50, in article
A257F6F1-9F8E-4416-8783-6CCB819F783A@microsoft.com, "Scott"
> I have seen similar behavior with HTML in general. I must say I run across
> many issues with the IDE as an HTML/ASPX editor.
[quoted text clipped - 58 lines]
>> little annoying in that the IDE is removing code that I explicitly put into
>> my program