Support for ASP.NET Master Pages

For technical support for all editions of CSS HTML Validator. Includes bug reports.
Post Reply
colinbo
Rank 0 - Newcomer
Rank 0 - Newcomer
Posts: 2
Joined: Sat Apr 08, 2006 11:39 am

Support for ASP.NET Master Pages

Post by colinbo » Sat Apr 08, 2006 11:43 am

Are there any plans to support ASP.NET Master Pages? Unlike traditional HTML pages, content fragments are stored in an ASPX file and reference a master page where the surrounding content exists.

We're currently evaluating HTML Validator and have found that it is unable to parse these pages because there is no BODY or other surrounding tags. As a result a number of false positive error messages show up.

Thanks,
Colin

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

Post by Albert Wiersch » Sat Apr 08, 2006 12:47 pm

Hi Colin,

CSE HTML Validator is designed to do some HTML/XHTML fragment checking. However, scripted pages may need to be processed by the server first, depending on how much script is in the page. CSE HTML Validator can accomodate for minor scripting by ignoring it, but not scripting that inserts tags and other structure elements. In that case it is best to check the HTML/XHTML output.

I'd really have to see the actual files you are talking about to tell you more. You can email them to me at support@htmlvalidator.com if you'd like.

Also, be sure you try the integrated web browser to check the output of your ASP.NET pages. Here is more information:
http://www.htmlvalidator.com/htmlval/v7 ... rside.html
http://www.htmlvalidator.com/htmlval/v7 ... owser.html

Please let me know if you have any more questions.
Image
Albert Wiersch

colinbo
Rank 0 - Newcomer
Rank 0 - Newcomer
Posts: 2
Joined: Sat Apr 08, 2006 11:39 am

Post by colinbo » Sat Apr 08, 2006 1:04 pm

Albert Wiersch wrote:CSE HTML Validator is designed to do some HTML/XHTML fragment checking. However, scripted pages may need to be processed by the server first, depending on how much script is in the page.
Take a look at the ASP.NET Master Pages Overview on MSDN for an overview how master pages work. We're implementing it with pretty much the same structure. The master page defines the header, side bar, and footer. The content body is a content placeholder control. The ASPX pages are the implementation of that content placeholder.

I can't seem to find any way to inform the validator that aspx files may be xhtml fragments. As a result I'm seeing error messages like this:

Code: Select all

The "div" element cannot be used here. It is not contained in an element that allows its use. This element may be contained in "body", "dd", "td", and "th".
<div id="content-body">
Is there something I'm missing in terms of fragment handling?

I'd like to avoid having to pre-process pages through a server as I would like to ideally have HTML Validator run as part of an automated build process on several projects.

User avatar
MikeGale
Rank VI - Professional
Rank VI - Professional
Posts: 711
Joined: Mon Dec 13, 2004 1:50 pm
Location: Tannhauser Gate

Post by MikeGale » Sat Apr 08, 2006 4:01 pm

I agree it's really useful to be able to check the source files.

I also find it essential to check the served pages.

In that regard I'm using something called SWEA in some tests (they're more general than unit tests). WATIR (pronounced water) gives similar functionality, though you need to learn Ruby to use it. (Looking at the code I imagine that translating my SWEA tests to WATIR is a fairly trivial exercise, though I haven't done it.)

These tests actually fire up IE, interact with the page through an automation interface and check the response generated in the browser. Very very useful.

I imagine your automation process can extend to using such a tool.

That still leaves automated validation testing though!!

(Irrespective of the published material on Master Pages, I imagine it would be very useful if you sent in the source (with any superfluous content removed if you like). That provides real examples and a testing base for Albert's own work.)

I'm currently working on the early stages of a .NET interface to the CSE DLL. It is not currently wired into a test framework. If it were the design could be different from conventional MBUnit (or whatever) test types or it could be designed to use existing constructs.

My work is not ready for sharing and might never be but it's easy to replicate. There is a VB6 project that does the work on the CSE site.
  • Convert it automatically.
  • Fix a few syntax things.
  • Merge the new header file information (.h files). Diff tool makes that fairly easy.
  • Throw out the P/Invoke / Declares. (I went for the DllImport format.)
  • And fire it up.
I'm currently working with the original Interop assemblies for RegEx and MSXML2 and it's working fine in .NET (1.1). It's a bit surreal when you first think about it, P/Invoke (DllImport) from the dll, process in .NET while using Interop to COM components. (I've always believed in pure .NET end to end, to see this just working feels really odd at first.)

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

Post by Albert Wiersch » Mon Apr 10, 2006 12:20 pm

colinbo wrote:Is there something I'm missing in terms of fragment handling?

I'd like to avoid having to pre-process pages through a server as I would like to ideally have HTML Validator run as part of an automated build process on several projects.
Hello,

Usually there's nothing you need to do to check fragments. For example, if I check

Code: Select all

<b>test</b>
CSE HTML Validator assumes it is in a "body" tag and generates this message:
The first tag in the document was out of range. The document has been checked with the assumption that a block of HTML that belongs in a <html><body> ... </body></html> section is being validated.

But since you have ASP code in there, it may not work smoothly. Can you send me a sample fragment page that demonstrates the problem? Please email it to support@htmlvalidator.com via attachment.

Also, you may want to experiment with the Tag range always valid option in Options->Validator Engine Options. That will disable "range checking" for all tags, however, so you're losing some syntax checking if you use it.
Image
Albert Wiersch

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

Post by Albert Wiersch » Tue Apr 11, 2006 11:08 am

Colin,

Thank you for sending me a sample file via email. Please try updating your HTML Configuration file with the below file and let me know how it works.
http://www.htmlvalidator.com/htmlval70cfg.zip

Note: The above update is only for CSE HTML Validator Std/Pro/Lite v7.0x.
Image
Albert Wiersch

Post Reply