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.3 Default Focus and Default Buttons

« Previous Chapter

End Lesson »

Professional web developers follow a standard by setting a focus on startup so the user is focused to a position of the web page you want the user to be on. This logical starting point can be used for instance, when entering data in a web page in a Form.

Note:

  • Browsers still force users to tab or move the mouse to enter the data they wish to fill in the form.

When using ASP.NET for web development, it makes it easier for creating sites which require data entry. ASP.NET forms let you set a default control and the following ASP.NET tutorial shows how to do this.

  1. Go to the Form control’s property page
  2. Set the “DefaultFocus” property to the name of the starting control for instance “txtFName”.

Now on rutime, the cursor automatically jumps to the text box named “txtFName” after the default control is set.
The ASP.NET Form control can also support a “DefaultButton” property which can be used to submit the form when the user presses the Enter Key. So at runtime, when the page loads, the ASP.NET page inserts a javascript sequence inside the <form> tag like the following.

<form id="form1" runat="server" onkeypress="javascript:return WebForm_FireDefaultButton(event, 'Button1')">

« Previous Chapter

End Lesson »

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]