AccessKey property of TextBox in .Net

Using the AccessKey property you can directly navigate to the control Or you can say directly focus to the control. Accesskey property is basically used for when you have a large page content and you want to directly navigate to particular control on that time you should use AccessKey property. Another one example is , suppose your mouse are not working properly on that time AccessKey will working for focusing control.

<%@ Page Language=”C#” %>
<!DOCTYPE html>
<script runat=”server”>
</script>
<html xmlns=”http://www.w3.org/1999/xhtml“>
<head runat=”server”>
    <title></title>
    <style type=”text/css”>
        .auto-style1 {
  text-decoration: underline;
        }
    </style>
</head>
<body>
    <form id=”form1″ runat=”server”>
    <div>
 
        <span>U</span>serName :

        <asp:TextBox ID=”TextBox1″ runat=”server” AccessKey=”U” Width=”159px”></asp:TextBox>
<br />
        <span>P</span>assWord :&nbsp;
        <asp:TextBox ID=”TextBox2″ runat=”server” AccessKey=”P” Width=”157px”></asp:TextBox>
        <br />
        <asp:Button ID=”Button1″ runat=”server” Text=”Submit” />
 
    </div>
    </form>
</body>
</html>


Output

AccessKey Property of TextBox in ASP.NET

 

AccessKey Property of TextBox in ASP.NET

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s