ASP.NET AccessKey Property

Definition and Usage

The AccessKey property is used to set or return the keyboard key used to access a control.

Note:Please use Alt + AccessKey Assign focus to an element by specifying a shortcut key.

Syntax

<asp:webcontrol id="id" AccessKey="accessKey" runat="server" />
Property Description
AccessKey Characters used to access the control.

Example

This example sets a shortcut key for the checkbox:

<form runat="server">
<asp:CheckBox id="check1" AccessKey="b" runat="server" />
</form>

Example

Add AccessKey to checkbox control