Project FAQ

Q. Will these templates make my ASP.NET website standards compliant?

A. No, but they will make it easier to achieve. The templates are designed to encourage standards-based web development through the use of valid, semantic mark-up, and separation of concerns between content (HTML), styling (CSS) & behavior (JavaScript). By default, ASP.NET renders built-in controls, like Menu & FormView, using tables for layout, which poses problems for accessibility & maintainability of your website. The XHTML 1.1 project template is pre-configured to use the CSS Friendly Control Adapters which change the HTML emitted by many of the ASP.NET server controls so that it is more conducive to this style of web development.

However other ASP.NET controls can still cause problems. The HyperLink control for example will invalid your XHTML 1.1 site if you set the target property (see below), as there is no target attribute to the anchor (a) tag in the XHTML 1.1 standard. Future versions of the templates will include code to help with these types of common mistakes.

<asp:HyperLink ID="lnkValidator" runat="server"
               Target="_blank" NavigateUrl="http://validator.w3.org">Validator</asp:HyperLink>

It is important to validate your HTML regularly to ensure your sites are actually standards compliant. See this article for details of how to add HTML validity checking to your ASP.NET projects using unit tests.

Q. I've installed the templates but I get errors when using the project template. What's the problem?

A. When using the project template, you must make sure you fix the reference to the CSSFriendly assembly (see image below). You do this by removing the existing reference and re-adding it, pointing to a valid location on your development machine. To get the CSSFriendly assembly you must download the latest source code of the CSS Friendly Control Adapters project and compile it. Do not use the release as it will not work. Unfortunately Visual Studio project templates only allow a single project with no other files so I can't include it.

CssRef.png

Q. I've downloaded the source code for the templates but I get errors during the build. What's the problem?

A. Check that you have installed the MSBuild Community Tasks. The source code solution uses the ZIP task to create the item & project template deployment files so you need to have them installed in order to build the solution.

Q. Doesn't Visual Studio 2008 already support XHTML 1.1? There's a drop-down menu in my toolbar that let's me select it

A. The option in the toolbar relates to IntelliSense support for XHTML 1.1 in the ASPX & HTML editors. Choosing this option will not change the actual HTML your ASP.NET generates in any way, it is simply a feature of the Visual Studio development environment. You should of course select XHTML 1.1 when using these templates to ensure you get support good from Visual Studio when developing standards compliant sites. Note however this will not pick-up validation errors for HTML emitted by ASP.NET server controls as it is only a design-time check.

Last edited Oct 27, 2008 at 10:00 AM by damianedwards, version 7

Comments

No comments yet.