AccessKey ' One of the Most Unused Features of ASP.NET

As I was doing some research for a section in my upcoming book I noticed a reference to using the Access key on the web control I was getting deeper with. I honestly had never noticed this property before and at first thought it was specific to this control. It is actually a property, overlooked evidently, of the base Web control class.
The AccessKey property Gets or sets the access key that allows you to quickly navigate to the Web server control. The way it works is you set a letter, say ‘T’ as the access key of a TextBox control and when the user clicks Alt+T the focus of the page will be sent to this TextBox, not matter where they are currently focused.
This property allows only a single character and will throw an exception is anything else is entered. This feature only works in Internet Explorer 4 and above. So I guess the lower browsers like Firefox and Safari are out of luck.
I think for a public web application this might not ever be used, but we as a group could say standardize a few control types. For example Alt+S will set the focus to the site search TextBox. This type of functionality would be great for Intranet applications and hidden Easter egg types of things in public applications.

Share This Article With Your Friends!

We use cookies to give you the best experience possible. By continuing, we'll assume you're cool with our cookie policy.

Install Love2Dev for quick, easy access from your homescreen or start menu.

Googles Ads Facebook Pixel Bing Pixel LinkedIn Pixel