ASP.NET Basics

HTML Basics
ASP.NET Web Server
Advanced HTML
Application Designing
Using Visual Studio
ASP.NET Standards
ASP.NET Styling
ASP.NET Navigation

ASP.NET Tips

ASP.NET Validation
HTML forms
CSS Styling
CSS Advanced
ASP.NET Features
ASP.NET Image Effects
Common mistakes
DB Design tips

Building Applications

Design Secure Apps
Build Secure Apps

5.2 Access Keys

« Previous Chapter

Next Chapter »

If you want to make the user of your web site jump to a control directly by way of a keyboard sequence rather than movement the mouse, you can use Access Keys also known as Accelerator/Shortcut keys.

For example:

When using ASP.NET you can use the “AccessKey” property of an ASP.NET control so you can access that control with the press of ALT + assigned key. The following ASP.NET tutorial shows how to apply an “AccessKey” property to an ASP.NET Label control.

  1. Open an ASP.NET page in the Design View.
  2. Add an ASP.NET Label control by dragging and dropping it from the Toolbox and name the label ID as “lblAccessKeyTest”.
  3. Next add an ASP.NET TextBox control by dragging and dropping it from the Toolbox and name the textbox ID as “txtAccessKeyTest”.
  4. Click on the Label control and press F4 to go to the Properties window, and set the “AccessKey” property to “A” and the “AssociatedControlID” property to “txtAccessKeyTest” and its “Text” property to  “<u>A</u>ccess Key”.

Accessibility Properties
Accessibility Properties

Now you can press the ALT + A key sequence on runtime to move the focus to the text box directly.

Note:

  • Test the access keys you use in all the browsers to make sure that they are not reserved for use by the browser.

« Previous Chapter

Next Chapter »

Table of Contents

Chapter 1 - HTML Web Standards
        Chapter 1.1 - Visual Studio and Standards
        Chapter 1.2 - External XHTML validation
Chapter 2 - Creating Columns Using CSS
        Chapter 2.1 - Page Layout using <div> tags
        Chapter 2.2 - ASP.NET Document Outline
        Chapter 2.3 - Style Rules for <div> tags
Chapter 3 - Improving Web Page Performance
        Chapter 3.1 - Turning off ViewState
        Chapter 3.2 - Caching Content
                Chapter 3.2.1 - Page-Level Caching
                Chapter 3.2.2 - Cache Period
Chapter 4 - Accessibility Requirements
        Chapter 4.1 - Image Alternate Text
        Chapter 4.2 - Avoiding Table for Layouts
        Chapter 4.3 - Client-side Scripts
        Chapter 4.4 - Validating Web Accessibility
Chapter 5 - Increasing Web Page Usability
        Chapter 5.1 - Tab Order
        » Chapter 5.2 - Access Keys
        Chapter 5.3 - Default Focus and Default Buttons

[top]