Home - Forums-.NET - FlyTreeView (ASP.NET) - XHTML Validation

FlyTreeView (ASP.NET)

Technical support and KB related to the FlyTreeView control

This forum related to following products: FlyTreeView for ASP.NET

XHTML Validation
Link Posted: 16-Nov-2009 07:44
Feature request: It would be nice if the FlyTreeView created content that was valid XHTML. I validate with HTMLTidy as a FireFox plugin, and it gives me the following issues: Warning: isn't allowed in
elements Warning: attribute "id" has invalid value "__NRSL_(My tree view UniqueID)" These don't affect how the TreeView functions, but they do mask other validation errors in my page, so can be a nuisance to work around. The ID issue shoud be easy to fix (in XML IDs can't start with an underscore value). The style issue is probably harder to fix, since I gather it's output dynamically based on the tree generation.
Link Posted: 16-Nov-2009 09:26
I agree with you. And we are always careful about standard compliance.
FlyTreeView renders valid XHTML in most cases.
Renderring  outside if  is only allowed when FlyTreeView detects that it is rendered within an update panel, so that this is the only way to emit required CSS rules.

Warning:  attribute "id" has invalid value "__NRSL_(My tree view UniqueID)"

What's DOCTYPE in your page? By default ASP.NET renders it's controls the following way:



No validation errors detected in this case.
You can check out page validity by clicking onto XHTML validation button in the bottom of the page.
http://www.9rays.net/asp.net_2/treeview/Demo_Office2003.aspx
Link Posted: 17-Nov-2009 07:20
I understand about the (unfortunate) necessity of the inline styles for trees in UpdatePanels.

Our doctype is currently:



I agree that ASP.net renders a few IDs with underscores, but I don't think it's valid for them either! Even though it's supported and frequently used, IDs are supposed to start with a letter (in XML and HTML). Here's one reference:

http://www.w3.org/TR/html4/types.html#h-6.2

Thanks for the response!