Disable errors caused by ASP.NET

For technical support for all editions of CSS HTML Validator. Includes bug reports.
Post Reply
CrispinH
Rank I - Novice
Rank I - Novice
Posts: 11
Joined: Mon Sep 22, 2008 10:51 am

Disable errors caused by ASP.NET

Post by CrispinH » Wed May 20, 2009 6:49 am

ASP.NET pages loaded from a URL contain errors over which I have no control and therefore I want to ignore them. In particular I get the following;

Code: Select all

<meta id="ctl00_keywords" name="keywords" ...
The validator is (quite correctly) complaining about the id attribute, but I'm not given the option of disabling this message when I right-click on the error message in the bottom window.

How do I disable this message?

Thanks

Crispin

User avatar
Albert Wiersch
Site Admin
Site Admin
Posts: 3451
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Post by Albert Wiersch » Wed May 20, 2009 5:17 pm

Thanks. That's interesting. Is this a common issue? Does ASP often use the "id" attribute for "meta" tags? If so, then I should probably make a special case of this so that the error message can be more easily disabled.

As it is now, you'll have to use the Configuration Editor in the professional edition to add the "id" (182) attribute to the "meta" (058) tag. This should help:
http://www.htmlvalidator.com/htmlval/configuration.html

Basically, just go to the Attributes tab and add "id" (182) to the "meta" (058) tag (select "meta (058)" as the Tag Name Being Configured). Remember to save the config with a new name or your changes to the default config file could be overwritten if the program is updated or reinstalled.
Image
Albert Wiersch

CrispinH
Rank I - Novice
Rank I - Novice
Posts: 11
Joined: Mon Sep 22, 2008 10:51 am

Post by CrispinH » Thu May 21, 2009 4:24 am

Hi Albert

The fix has worked fine. I'll just have to remember it might disappear on an update.

With regard to it being a common issue: I think the ID will appear in any tag rendered by ASP.NET when the runat="server" attribute is specified ie frequently, and possibly in many of the header tags.

The other thing that ASP.NET does is have a hidden field with name and ID values of __VIEWSTATE. This is going to appear in 99% of ASP.NET pages - ie all those without Viewstate explicitly turned off - and the double underscore causes a validation error.

However ASP.NET errors only occur if you load a page from the web. I tend to load from the web because pages with server controls frequently only make sense when loaded from the web. However this does mean that it would be possible to read the HTTP Response Headers which, by default, on an IIS server have a name value pair of X-Powered-By: ASP.NET. Once detected, ASP.NET validation annoyances could be disabled.

Crispin

User avatar
Albert Wiersch
Site Admin
Site Admin
Posts: 3451
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Post by Albert Wiersch » Thu May 21, 2009 8:59 am

CrispinH wrote:Hi Albert

The fix has worked fine. I'll just have to remember it might disappear on an update.
Great! If you save the config file with a custom name and use that file as the default, then any updates shouldn't change it.
CrispinH wrote:With regard to it being a common issue: I think the ID will appear in any tag rendered by ASP.NET when the runat="server" attribute is specified ie frequently, and possibly in many of the header tags.

The other thing that ASP.NET does is have a hidden field with name and ID values of __VIEWSTATE. This is going to appear in 99% of ASP.NET pages - ie all those without Viewstate explicitly turned off - and the double underscore causes a validation error.

However ASP.NET errors only occur if you load a page from the web. I tend to load from the web because pages with server controls frequently only make sense when loaded from the web. However this does mean that it would be possible to read the HTTP Response Headers which, by default, on an IIS server have a name value pair of X-Powered-By: ASP.NET. Once detected, ASP.NET validation annoyances could be disabled.
Thanks for the info. Would it be possible for you to send me (via email to support at htmlvalidator dot com) some ASP pages you have loaded from the web that have these validation issues? If they aren't difficult to address, then I may be able to get them in the next v9.0x update.
Image
Albert Wiersch

CrispinH
Rank I - Novice
Rank I - Novice
Posts: 11
Joined: Mon Sep 22, 2008 10:51 am

Post by CrispinH » Thu May 21, 2009 9:28 am

Take a look at the source for:

www.file-centre.co.uk
www.commercialtransfer.co.uk

Both these sites have viewstate enabled.

I'm probably wrong about 99% of ASP.NET web pages, I think it applies to ASP.NET sites using master pages.

Crispin

User avatar
Albert Wiersch
Site Admin
Site Admin
Posts: 3451
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Post by Albert Wiersch » Fri May 22, 2009 4:58 pm

CrispinH wrote:Take a look at the source for:

www.file-centre.co.uk
www.commercialtransfer.co.uk
Thanks. I'll take a look next week or so and see if I can improve this in the next minor update.
Image
Albert Wiersch

User avatar
Albert Wiersch
Site Admin
Site Admin
Posts: 3451
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Re: Disable errors caused by ASP.NET

Post by Albert Wiersch » Wed Jun 17, 2009 11:33 am

I've looked into this issue and, in the next update will be a configuration file that allows "id" for "meta". If the "id" attribute is used in a "meta" tag, then CSE HTML Validator will generate a message like this:
[19] Attributes often used by ASP.NET were detected 2 times. ASP.NET attributes are not official HTML or XHTML attributes. However, many ASP.NET attributes are ignored because they are unlikely to cause problems with browsers. Tip: Do a "Standards compliant check" to cause ASP.NET attributes to generate error messages so they can be found.

If one does a "Standards compliant check" then it will generate errors for the "id" attribute in the "meta" tag.
Image
Albert Wiersch

CrispinH
Rank I - Novice
Rank I - Novice
Posts: 11
Joined: Mon Sep 22, 2008 10:51 am

Re: Disable errors caused by ASP.NET

Post by CrispinH » Wed Jun 17, 2009 12:50 pm

Thanks Albert.

For information, I've been looking into Model-View-Controller ASP.NET websites recently and they don't have these non-standard tags.

Crispin

armplinker
Rank 0 - Newcomer
Rank 0 - Newcomer
Posts: 6
Joined: Mon Oct 08, 2012 9:48 am

Re: Disable errors caused by ASP.NET

Post by armplinker » Mon May 04, 2015 10:58 am

I am sorry if this has already been asked, but I am getting a zillion namespace errors like this:

Error in line 373 at character 38: The "asp:LinkButton" tag specifies an undeclared namespace prefix "asp".

and

Error in line 391 at character 30: The "telerik:RadMultiPage" tag specifies an undeclared namespace prefix "telerik".

for the asp and telerik namespaces. I checked web.config and the appropriate section is there to register the telerik prefix for pages in the web application, but web.config is not involved in the validation process. How can I either add the right namespace references ( which I may actually NOT want to do ) or suppress this namespace prefix error and concentrate on attribute value problems and so on?

Thank you.

User avatar
Albert Wiersch
Site Admin
Site Admin
Posts: 3451
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Re: Disable errors caused by ASP.NET

Post by Albert Wiersch » Mon May 04, 2015 2:02 pm

armplinker wrote:I am sorry if this has already been asked, but I am getting a zillion namespace errors like this:

Error in line 373 at character 38: The "asp:LinkButton" tag specifies an undeclared namespace prefix "asp".

and

Error in line 391 at character 30: The "telerik:RadMultiPage" tag specifies an undeclared namespace prefix "telerik".
Hello,

I've improved the handling of these ASP.NET issues in v15.0211 which you can download here (currently only the pro edition):
https://www.htmlvalidator.com/download/registered.php

Note that the above page currently says that v15.0200 is available but the download should actually be for v15.0211.

Please download it and update and let me know if it addresses the problems you mentioned.

Thanks!
Image
Albert Wiersch

armplinker
Rank 0 - Newcomer
Rank 0 - Newcomer
Posts: 6
Joined: Mon Oct 08, 2012 9:48 am

Re: Disable errors caused by ASP.NET

Post by armplinker » Mon Jan 25, 2016 5:03 pm

OK I am way behind on this but I do notice that these still happen for 'user controls' that are registered at the top of the aspx page e.g.
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="LBIS8.DocViewer.aspx.cs" Inherits="LBIS8.DocViewer" %>

<%@ Register Src="SingleDocView.ascx" TagName="SingleDocView" TagPrefix="uc1" %>

<html lang="en">

and this statement later is reported as an Error

<ItemTemplate>
<uc1:SingleDocView ID="SingleDocView1" DocUrl='<%#Eval("target_file_name") %>' DocKey='<%#Eval("doc_key")%>'
DocLevel='<%#Eval("doc_level") %>'
UploadedDtTmStamp='<%#Eval("uploaded_at") %>' ModifiedDtTmStamp='<%#Eval("updated_at") %>'
UploadedBy='<%#Eval("uploaded_by") %>' UpdatedBy='<%#Eval("updated_by") %>' Editable='<%#Eval("editable")%>'
Title='<%#Eval("doc_title") %>' Selectable='<%#Eval("selectable") %>' TitleLabel='Document Title:'
NotesLabel='' ShowNotes='0'
CssClass="Content/styles.css"
runat="server" />
</ItemTemplate>

armplinker
Rank 0 - Newcomer
Rank 0 - Newcomer
Posts: 6
Joined: Mon Oct 08, 2012 9:48 am

Re: Disable errors caused by ASP.NET

Post by armplinker » Mon Jan 25, 2016 5:04 pm

Oh and this is pretty old-school code by the way. Bringing it into this decade...

User avatar
Albert Wiersch
Site Admin
Site Admin
Posts: 3451
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Re: Disable errors caused by ASP.NET

Post by Albert Wiersch » Tue Jan 26, 2016 8:56 am

Hello,

Thanks for the report. To make sure I address this properly, can you email me (via attachment to support at htmlvalidator dot com) one or more small sample documents that I can use to reproduce the problem and the text of the error or warning messages that you are getting that you think you should not be getting?
Image
Albert Wiersch

Post Reply