Version 2.0 fails in W3C Markup Validation

Topics: ASP.NET 2.0
Jun 13, 2011 at 3:11 PM
Edited Jun 13, 2011 at 3:12 PM

Due to the addition of the query string "&minify=" to the following external script definition, BlogEngine.NET 2.0 fails the W3C Markup Validation:

<script type="text/javascript" src="/BlogEngine2/js.axd?path=Scripts%2fblog.js&minify=">
<script type="text/javascript" src="/BlogEngine2/js.axd?path=%2fBlogEngine2%2fadmin%2fwidget.js&minify=">

In addition, the query string "&page=n" is added to the url of the pager links. This will also cause the failure of validation.


Do you have any idea to fix the above problem and to pass the W3C Markup Validation?

Jun 13, 2011 at 5:31 PM

You could try to add

validateRequest="false" to the @Page directive.


Jun 13, 2011 at 7:30 PM

Try replacing "&" with "&amp;". This will validate:

<script type="text/javascript" src="/BlogEngine2/js.axd?path=Scripts%2fblog.js&amp;minify="></script>
<script type="text/javascript" src="/BlogEngine2/js.axd?path=%2fBlogEngine2%2fadmin%2fwidget.js&amp;minify=">

Jun 14, 2011 at 1:32 PM

> Try replacing "&" with "&amp;".

It is not that easy because the BlogEngine.Core.dll automatically generates the script definitions with the query string of "&minify=".  Therefore, I cannot simply replace "&" with "&amp;".

For your information I found that the following methods includes the code to generate the query strings of "&minify=" and "&page=n" which cause the failure in the W3C markup validation:

(1) "&minify="
  - ResolveScriptUrl method in the Core\Utils.cs

(2) "&page=n" (n is page number)
  - PageUrl method in App_Code/Control/PostPager.cs, and
  - InitPaging method in User controls/PostList.ascx.cs

I am expecting that the developers will fix it in the next release of BlogEngine.NET 2.0.