Contents tagged with Accessibility

  • ASP.NET Labels with Associated Controls inside of User Controls

    I've been trying to use labels with the AssociatedControlID property more often.  If you aren't familiar with this property, it changes the behavior of the Label control.  Rather than rendering the typical <span> html element, the Label control will now render a <label> html element with the for property set.  This links the label to another server control.  This is good for accessibility, allows hotkeys to be set for the associated control, and also allows the user to click on the label in order to give focus to the associated control. Syntax is as follows