Sets the browser focus to the specified control.
Syntax
CSharp
public void SetFocus (
Control control
)
VisualBasic
Public Sub SetFocus ( _
control As Control _
)
ManagedCPlusPlus
public:
void SetFocus (
Control^ control
)
JSharp
public void SetFocus (
Control control
)
Parameters
- control (Control)
The control to receive focus.
Remarks
The SetFocus method works like the SetFocus(Control) method for the Page class. Both methods make the specified control the active control on the Web page. The SetFocus method of the ScriptManager class is for setting focus during asynchronous postbacks. During postbacks and when the page is first rendered, the SetFocus method calls the SetFocus(Control) method of the Page class.
If there are multiple calls to the SetFocus method, the control in the last call receives focus.
Assembly: System.Web.Extensions (Module: System.Web.Extensions)