6468

Rendering ASP.NET Validators And Validation Summary Property As HTML Attributes

Yesterday I blogged about the cause of ASP.NET validators and validation summary slowness.


At that point I wasn't aware of the existence of the XHTML conformance configuration (thanks Nuno).


With the XHTML conformance configuration set to Legacy, the rendering of controls works like it worked in ASP.NET 1.1.

The Cause Of ASP.NET Validators And Validation Summary Slowness

When building ASP.NET pages, if you use too many validators and validation summaries your pages can become very slow. Have you ever wondered why?


Lets build a simple page web page with a few validators. Something like this:


Web page with validation


The page is composed of:



ASP.NET renders the ValidationSummary as a DIV and each validator as a SPAN and uses expando attributes to add properties to those elements.


According to the documentation, expando attributes are set dynamically from JavaScript to preserve XHTML compatibility for the rendered control's markup.


The problem is that all that JavaScript makes the HTML document larger and slower to execute than if the properties were rendered in HTML as attributes of the elements.


For such a small page, the difference in size approaches 2k bytes. If you add a few dozen validators to he page, the slowness is noticeable.


I'm all in favor of strict standards and standards compliance, but in this case, I wish XHTML would allow arbitrary attributes.

Web Client Software Factory 2.0 shipped

Web Client Software Factory 2.0

February 2008 Release

 

Resources

About the Deliverable

The Web Client Software Factory (WCSF) provides a set of guidance for architects and developers building enterprise Web applications. The factory includes samples, reusable code and a guidance package which automates key development tasks from within Visual Studio.

Using the Web Client Software Factory assets, developers can create Composite Web applications composed of independently developed and deployed modules. These modules are dynamically brought together at runtime into a common shell. Additionally the factory includes support for ASP.NET AJAX thus providing users with a richer and more responsive user experience.

New In This Release

The February 2008 release of the Web Client Software Factory has the following improvements to the June 2007 release.

  • Full support for Visual Studio 2008 and .NET Framework 3.5
  • Added ASP.NET AJAX extenders for Context Sensitive Autocomplete, AJAX Validation, and Real Time Search that can be used in existing ASP.NET sites and ASP.NET sites built using the Composite Web Application Block.
  • Added UI Composition capability through extending our dependency injection mechanism to support Pages, User Controls and Master Pages.
  • Added Dependency Injection on ASMX Web Services and JSON services.
  • Added a new set of Quickstarts and How-To topics on MVP, Modularity and the new AJAX extenders
  • Added a new Order Entry Reference application that demonstrates all of the new functionality.

In addition, this release of WCSF has the following community issues and fixes:

  • 42 Workitems closed including the top-voted items on CodePlex
  • Add ASP.NET AJAX Support (97 votes)
  • Web Client Software Factory Support for Enterprise Library 3.1 (62 votes)
  • Services through configuration (32 votes)
  • Support for using the Validation Application Block (16 votes)
  • Recipe support for Visual Basic .NET (20 votes)
  • Added Presenter support for Master Pages (11 votes)

WCSF geekSpeak: Download Available On Channel 9

WCSF geekSpeak: Download Available At MSEVENTS

For those who missed my webcast (and wanted to watch it) it's available to download at the MSEVENTS site.

WCSF geekSpeak: Online Resources

Here is the list of topics covered in the WCSF geekSpeak webcast:

  1. Contextual Auto Complete Bundle
    Demo code: WCSF geekSpeak: Contextual Auto Complete Bundle Demo Code
  2. Validation Bundle
    Demo code: WCSF geekSpeak: Validation Bundle Demo Code
  3. Real-Time Search Bundle
    Demo code: WCSF geekSpeak: Real-Time Search Bundle Demo Code
  4. MVP Bundle
  5. Modularity Bundle
  6. Page Flow Application Block
  7. E-Commerce Catalog
  8. EventBroker extension

And here is a list of online resources:

WCSF geekSpeak: Real-Time Search Bundle Demo Code

This demo e based on the demo included in the Real-Time Search Bundle download.


The demo includes an entry form with two implementations:




  1. Using an Update Panel.


  2. Using the WCSF's Real-Time Search Monitor.

WCSF geekSpeak: Validation Bundle Demo Code

This demo e based on the demo included in the Validation Bundle download.


The demo includes an entry form with three implementations:




  1. Using the traditional server-side validation.


  2. Using server-side validation with the Enterprise Library's Validation Application Block.


  3. Using server-side validation with the Enterprise Library's Validation Application Block and the WCSF's Server-Side Validation Extender.

WCSF geekSpeak: Contextual Auto Complete Bundle Demo Code

This demo e based on the demo included in the Contextual Auto Complete Bundle download.


The demo includes an entry form with three implementations:




  1. Using the traditional auto post back model


  2. Using an update panel


  3. Using the Contextual Auto Complete Extender.

Free e-books on the Visual Studio 2008 Learning Portal

Microsoft is offering free e-books (or, at least some chapters) in the Visual Studio 2008 Learning Portal.