Better accessibility with AccessKey in Asp.net controls

All of us has seen that every control in Asp.net has a property called AccessKey, but many of us do not know (or may be lazy to know) and use it. But I think it is a good feature that can increase accessibility of a website. Specially Linux user/ users who do not use mouse that frequently can access the fields with short cut key.

How to set it? Well it is so simple. Just set the AccessKey property to a letter. For example, myControl.AccessKey = “U”

and then access the field with shortcut “Alt+U” (in firefox Alt+Shift+U)

you must make sure that you have not set a short cut that is already a shortcut for the browser itself. that is setting AccessKey= “L” will not work in firefox as it is reserved by firefox itself.

You can also mark the label of the control with underscore (which is a norm for shortcut key) so that users can understand that this field has shortcut key support. For example, Name where “N” is AccessKey for this field.

Published 11-22-2009 9:39 PM by Jalal
Filed under: ,
Powered by Community Server (Non-Commercial Edition), by Telligent Systems