Why is this comment causing a Parser Error?

738 Views Asked by At

When trying to open a particular page in an asp.net app, I get a YSOD with:

Server Error in '/CommonLoon' Application.

Parser Error

Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. 

Parser Error Message: Only Content controls are allowed directly in a content page that contains Content controls.

Source Error: 


Line 9:  </asp:Content>
Line 10: 
Line 11: <!-- Might want to replace this old .css with a newer version, such as 1.10.2: http://code.jquery.com/ui/1.10.2/themes/smoothness/jquery-ui.css -->
Line 12: <asp:Content ID="indexStyles" ContentPlaceHolderID="MainHead" runat="server">
Line 13:     <link type="text/css" href="/<%= System.Configuration.ConfigurationManager.AppSettings["ThisApp"] %>/Content/jquery-ui-1.8.16.custom.css"

Source File: /CommonLoon/Views/Home/Index.aspx    Line: 11 

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272

First of all, why is a commented out line a problem?

Second of all...well second of this, anyway: That file does not (or no longer) has that comment in it; instead, it is now this on that line:

<!-- 5/6/2013: Replace 1.8.16 with a newer css, such as http://code.jquery.com/ui/1.10.2/themes/smoothness/jquery-ui.css? The "custom" part of the name of the file makes me hesitate to make a change, though... -->

Where is that old version of the file coming from? The phrase "Might want to" does not appear anywhere in the solution...???

UPDATE

Stranger yet; I just uncommented some heretofore commented out jQjuery to test the old functionality, and failed to notice there was a comment that should have prevented the code from compiling, namely:

$("#BeginDate").datepicker( try this as a anytime date component

...yet it compiled and ran! Heavens to Murgatroid! What's up with that?!?!?

1

There are 1 best solutions below

0
On
Server Error in '/' Application.
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: The server tag is not well formed.

Source Error:


Line 206:            //}
Line 207:            //newStr += "&pword=" document.getElementById('pword').value;
Line 208:            //for (i = 1; i < 8; i++) {
Line 209:            //    if (document.getElementById('app_' + i).checked) {
Line 210:            //        newStr += '&app_' + i + "=1";

Source File: /StockItems.aspx    Line: 208

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET     Version:4.8.4494.0

For what it is worth over nine years later, this is the error that I can reproduce reliably if on line 219 (eleven lines later than when the error is highlighted) I insert either this comment:

/* NOTE: runat=server */

or

// NOTE: runat=server

or

// NOTE: runat="server"

The program runs on making a single change to either the word 'runat' or 'server'. Spaces around the `=' don't make any difference.