[Mono-bugs] [Bug 517656] New: HTML comment in ASPX file causes "Literal content not allowed for System.Web.UI.WebControls.ListItemCollection" Exception
bugzilla_noreply at novell.com
bugzilla_noreply at novell.com
Tue Jun 30 02:13:32 EDT 2009
http://bugzilla.novell.com/show_bug.cgi?id=517656
Summary: HTML comment in ASPX file causes "Literal content not
allowed for
System.Web.UI.WebControls.ListItemCollection"
Exception
Classification: Mono
Product: Mono: Runtime
Version: 2.4.x
Platform: i386
OS/Version: Windows XP
Status: NEW
Severity: Normal
Priority: P5 - None
Component: misc
AssignedTo: mono-bugs at lists.ximian.com
ReportedBy: spam at sigphi.ca
QAContact: mono-bugs at lists.ximian.com
Found By: ---
Created an attachment (id=301354)
--> (http://bugzilla.novell.com/attachment.cgi?id=301354)
Example ASPX file that causes the exception
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1)
Gecko/20090624 Firefox/3.5 (.NET CLR 3.5.30729)
HTML comments in ASPX files cause exceptions for me on all the 2.4.2 betas,
release candidates, and the final release.
The same mark-up works fine on Mono 2.4, Mono 2.2, and I believe back to at
least 1.9.1 although I would not take my thoughts on earlier than 2.2 as
gospel.
As an example, the following mark-up:
<%@ Page Language = "C#" %>
<html><body>
<p>ASP.NET repeater control to follow...</p>
<asp:Repeater id="censusRepeater" runat="server">
<HeaderTemplate />
<ItemTemplate>
<tr>
<td><asp:Label id="idLabel" runat="server" /></td>
<td>
<asp:TextBox id="birthBox" runat="server" />
</td>
<!-- We do not ask if you are married
<td>
<asp:radiobuttonlist id="spouseRadioButtonList" runat="server">
<asp:listitem id="Married" runat="server" value="Yes" />
<asp:listitem id="Single" runat="server" value="No" />
</asp:radiobuttonlist>
<asp:Checkbox id="marriedCheckbox" runat="server" />
</td>
-->
<td>
<asp:TextBox id="spouseBirthBox" runat="server" />
</td>
<td>
<asp:DropDownList id="childrenDropDownList" runat="server">
<asp:listitem>0</asp:listitem>
<asp:listitem>1</asp:listitem>
<asp:listitem>2+</asp:listitem>
</asp:DropDownList>
</td>
</tr>
</ItemTemplate>
<FooterTemplate />
</asp:Repeater>
</body></html>
causes a yellow screen of death with the following exception:
Server Error in '/main' Application
Literal content not allowed for System.Web.UI.WebControls.ListItemCollection
Description: HTTP 500. Error processing request.
Stack Trace:
System.Web.HttpException: Literal content not allowed for
System.Web.UI.WebControls.ListItemCollection
at System.Web.UI.CollectionBuilder.AppendLiteralString (System.String s)
[0x00000]
at System.Web.UI.ControlBuilder.AppendLiteralString (System.String s)
[0x00000]
at System.Web.Compilation.AspGenerator.FlushText (Boolean ignoreEmptyString)
[0x00000]
at System.Web.Compilation.AspGenerator.TagParsed (ILocation location, TagType
tagtype, System.String tagid, System.Web.Compilation.TagAttributes attributes)
[0x00000]
at System.Web.Compilation.AspParser.OnTagParsed (TagType tagtype,
System.String id, System.Web.Compilation.TagAttributes attributes) [0x00000]
at System.Web.Compilation.AspParser.Parse () [0x00000]
at System.Web.Compilation.AspGenerator.ParseAttributeTag (System.String code)
[0x00000]
at System.Web.Compilation.AspGenerator.TextParsed (ILocation location,
System.String text) [0x00000]
at System.Web.Compilation.AspParser.OnTextParsed (System.String text)
[0x00000]
at System.Web.Compilation.AspParser.Parse () [0x00000]
at System.Web.Compilation.AspGenerator.Parse (System.IO.TextReader reader,
System.String filename, Boolean doInitParser) [0x00000]
at System.Web.Compilation.GenericBuildProvider`1[TParser].Parse () [0x00000]
at
System.Web.Compilation.GenericBuildProvider`1[TParser].get_CodeCompilerType ()
[0x00000]
at System.Web.Compilation.BuildManager.GetCodeDomProviderType
(System.Web.Compilation.BuildProvider provider) [0x00000]
at System.Web.Compilation.BuildManager+BuildItem..ctor
(System.Web.Compilation.BuildProvider provider) [0x00000]
at System.Web.Compilation.BuildManager.LoadBuildProviders
(System.Web.VirtualPath virtualPath, System.String virtualDir,
System.Collections.Generic.Dictionary`2 vpCache,
System.Web.Compilation.BuildKind& kind, System.String& assemblyBaseName)
[0x00000]
at System.Web.Compilation.BuildManager.BuildAssembly (System.Web.VirtualPath
virtualPath) [0x00000]
at System.Web.Compilation.BuildManager.GetCompiledType (System.String
virtualPath) [0x00000]
at System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath
(System.String virtualPath, System.Type requiredBaseType) [0x00000]
at System.Web.UI.PageParser.GetCompiledPageInstance (System.String
virtualPath, System.String inputFile, System.Web.HttpContext context) [0x00000]
at System.Web.UI.PageHandlerFactory.GetHandler (System.Web.HttpContext
context, System.String requestType, System.String url, System.String path)
[0x00000]
at System.Web.HttpApplication.GetHandler (System.Web.HttpContext context,
System.String url, Boolean ignoreContextHandler) [0x00000]
at System.Web.HttpApplication.GetHandler (System.Web.HttpContext context,
System.String url) [0x00000]
at System.Web.HttpApplication+<Pipeline>c__Iterator5.MoveNext () [0x00000]
Version information: Mono Version: 2.0.50727.1433; ASP.NET Version:
2.0.50727.1433
If the HTML comment is removed it works fine.
>From the mark-up above, here is what I mean by HTML comment:
<!-- We do not ask if you are married
<td>
<asp:radiobuttonlist id="spouseRadioButtonList" runat="server">
<asp:listitem id="Married" runat="server" value="Yes" />
<asp:listitem id="Single" runat="server" value="No" />
</asp:radiobuttonlist>
<asp:Checkbox id="marriedCheckbox" runat="server" />
</td>
-->
With the offending HTML comment removed, the mark-up (and any associated code
behind files as well) compiles and executes as expected. At least it does on
the release version of Mono 2.4.2 (which came out today).
Reproducible: Always
Steps to Reproduce:
1. Create an ASPX file with the mark-up as above
2. Run XSP2 from Mono 2.4.2
3. Try to open the ASPX file in a browser (I use Firefox 3.5)
Actual Results:
Server Error in '/main' Application
Literal content not allowed for System.Web.UI.WebControls.ListItemCollection
Description: HTTP 500. Error processing request.
Stack Trace:
System.Web.HttpException: Literal content not allowed for
System.Web.UI.WebControls.ListItemCollection
at System.Web.UI.CollectionBuilder.AppendLiteralString (System.String s)
[0x00000]
at System.Web.UI.ControlBuilder.AppendLiteralString (System.String s)
[0x00000]
at System.Web.Compilation.AspGenerator.FlushText (Boolean ignoreEmptyString)
[0x00000]
at System.Web.Compilation.AspGenerator.TagParsed (ILocation location, TagType
tagtype, System.String tagid, System.Web.Compilation.TagAttributes attributes)
[0x00000]
at System.Web.Compilation.AspParser.OnTagParsed (TagType tagtype,
System.String id, System.Web.Compilation.TagAttributes attributes) [0x00000]
at System.Web.Compilation.AspParser.Parse () [0x00000]
at System.Web.Compilation.AspGenerator.ParseAttributeTag (System.String code)
[0x00000]
at System.Web.Compilation.AspGenerator.TextParsed (ILocation location,
System.String text) [0x00000]
at System.Web.Compilation.AspParser.OnTextParsed (System.String text)
[0x00000]
at System.Web.Compilation.AspParser.Parse () [0x00000]
at System.Web.Compilation.AspGenerator.Parse (System.IO.TextReader reader,
System.String filename, Boolean doInitParser) [0x00000]
at System.Web.Compilation.GenericBuildProvider`1[TParser].Parse () [0x00000]
at
System.Web.Compilation.GenericBuildProvider`1[TParser].get_CodeCompilerType ()
[0x00000]
at System.Web.Compilation.BuildManager.GetCodeDomProviderType
(System.Web.Compilation.BuildProvider provider) [0x00000]
at System.Web.Compilation.BuildManager+BuildItem..ctor
(System.Web.Compilation.BuildProvider provider) [0x00000]
at System.Web.Compilation.BuildManager.LoadBuildProviders
(System.Web.VirtualPath virtualPath, System.String virtualDir,
System.Collections.Generic.Dictionary`2 vpCache,
System.Web.Compilation.BuildKind& kind, System.String& assemblyBaseName)
[0x00000]
at System.Web.Compilation.BuildManager.BuildAssembly (System.Web.VirtualPath
virtualPath) [0x00000]
at System.Web.Compilation.BuildManager.GetCompiledType (System.String
virtualPath) [0x00000]
at System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath
(System.String virtualPath, System.Type requiredBaseType) [0x00000]
at System.Web.UI.PageParser.GetCompiledPageInstance (System.String
virtualPath, System.String inputFile, System.Web.HttpContext context) [0x00000]
at System.Web.UI.PageHandlerFactory.GetHandler (System.Web.HttpContext
context, System.String requestType, System.String url, System.String path)
[0x00000]
at System.Web.HttpApplication.GetHandler (System.Web.HttpContext context,
System.String url, Boolean ignoreContextHandler) [0x00000]
at System.Web.HttpApplication.GetHandler (System.Web.HttpContext context,
System.String url) [0x00000]
at System.Web.HttpApplication+<Pipeline>c__Iterator5.MoveNext () [0x00000]
Version information: Mono Version: 2.0.50727.1433; ASP.NET Version:
2.0.50727.1433
Expected Results:
ASP.NET repeater control to follow...
--
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
More information about the mono-bugs
mailing list