System.Web.UI.Page.SetFocus Method

Sets the browser focus to the control with the specified identifier.

Syntax

public void SetFocus (string clientID)

Parameters

clientID
The ID of the control to set focus to.

Remarks

Use the Page.SetFocus(string) method to make the control with the specified ID string the active control in the Web page displayed by the browser. The Page.SetFocus(string) method must be called before the page is prepared for rendering to the client in the Control.PreRender event.

Note:

The Page.SetFocus(string) method will work only on browsers supporting ECMAScript version 1.3 or later.

Requirements

Namespace: System.Web.UI
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0