System.Web.UI.Page.SetFocus Method

Sets the browser focus to the specified control.

Syntax

public void SetFocus (Control control)

Parameters

control
The control to receive focus.

Remarks

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

Note:

The Page.SetFocus(Control) 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