10.14. Accessibility and Standards

Accessibility and standards, whether you like it or not, are becoming increasingly important. Microsoft is aware of this and has introduced a number of changes.

10.14.1. controlRenderingCompatibilityVersion

The pages section in Web.config contains a new controlRenderingCompatibilityVersion property that determines how controls are rendered by default. The controlRenderingCompatibilityVersion property can be set to 3.5 or 4.0.

<system.web>
  <pages controlRenderingCompatibilityVersion="4.0"/>
</system.web>

Setting controlRenderingCompatibilityVersion to 3.5 will ensure ASP.NET renders as in ASP.NET 3.5. If, however, you set controlRenderingCompatibilityVersion to 4.0, then Microsoft says that the following will occur:

  • The xhtmlConformance property will be set to Strict, and controls will be rendered according to XHTML 1.0 Strict markup.

  • Disabled controls will not have invalid styles rendered.

  • Hidden fields that have <div> elements around them will now be styled in a manner that will not interfere with user-defined CSS rules.

  • Menu controls are now rendered using unordered list (<ul>) tags (fantastic!).

  • Validation controls will not use inline styles.

  • Previously some controls such as Image rendered the property border="0"; this will no longer occur.

10.14.2. RenderOuterTable

Previous versions of ASP.NET used a Table tag to wrap the following controls:

  • ChangePassword

  • FormView

  • Login

  • PasswordRecovery

In ASP.NET 4.0, however, all these controls support a new RenderOuterTable property that, if set to false, will use a <div> instead.

10.14.3. CheckBoxList and RadioButtonList

CheckBoxList and RadioButtonList benefit from a new property called RepeatLayout. RepeatLayout has four modes—UnorderedList, OrderedListproperty, Flowproperty, and Tableproperty—allowing you fine control over how they are rendered.

10.14.4. ASP.NET Menu Control

The ASP.NET Menu control now renders menu items using unordered list elements. Keyboard support for the menu has also been improved, so once an ASP.NET menu receives focus, the user can navigate through menu items using the arrow keys.

10.14.5. Browser Capability Files

Browser capability files are used to determine how best to render content for individual browsers and are held in XML format. If you feel the need, you can create your own browser provider by deriving from the HttpCapabilitiesProvider class.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.139.97.53