Library tutorials & articles

Valid XHTML within .NET

Introduction

The first article in this series will concentrate on the HtmlForm control and its child controls, deciding how we can best modify the default implementation and extend its capabilities so that it will validate to the W3C's XHTML 1.0 and 1.1 strict standards. Additionally we'll look at how the default instance uses client-side validation and how this too can be improved.

In order to test and run sample code included in this document, a text editor and C# compiler will be required along with an ASP.NET compatible Web server. All sample code has been developed and tested using Windows 2000 Professional running IIS 5.0 and version 1.1 of the .NET Framework. There should be no issues using later versions of Windows operating system. It is also possible to use the "Mono" project's compiled source-code running on most Linux distributions.

Assumptions

The source-code in this article is written in C# and ASP.NET. It is assumed that you have a basic understanding of both C# and ASP.NET as well as the essentials of the CLR (or equivalent runtime) and its associated development tools. The code listed is CLS-compliant so you can easily replace the C# code with an alternate CLI-compatible language. It is also assumed that the requirements for creating XHTML compliant Web pages are understood.

Limitations

This article makes no provisions for the XHTML-Basic standard as this is targeted at mobile devices and thus covered by Microsoft's ASP.NET mobile controls.

XHTML 2.0 is currently unsupported by most major browsers or has yet to make recommended status and is thus out of the scope of this article. The solutions discussed here can be applied to this standard if required.

Comments

  1. 19 Aug 2005 at 12:43

    Have you tried putting any asp.net controls on your page, (such as an asp:button control)? I tried and got an error telling me that the "Control 'x' of type 'y' must be placed inside a form tag with runat=server".  Now, I know that the control is between the form tags and runat is set to server, so what is going on?

  2. 01 Jan 1999 at 00:00

    This thread is for discussions of Valid XHTML within .NET.

Leave a comment

Sign in or Join us (it's free).

Kevin Brown
AddThis

Related podcasts

Events coming up

  • Jul 7

    DTC 70-528 Session 7: Chapter 12

    Greenwood Village, United States

    Due to lack of interest of the 5th Monday meetup, we will continue as originally scheduled. The topic of the night will be "Chapter 12 - Creating ASP.NET Mobile Web Applications", taught by RJ Hatch. It is a fairly small chapter, so we can discuss other topics as well. Pizza and beverages will be provided on a donation basis.

Want to stay in touch with what's going on? Follow us on twitter!