Sets the browser focus to the control that has the specified identifier.
Syntax
CSharp
public void SetFocus (
string clientID
)
VisualBasic
Public Sub SetFocus ( _
clientID As String _
)
ManagedCPlusPlus
public:
void SetFocus (
String^ clientID
)
JSharp
public void SetFocus (
String clientID
)
Parameters
- clientID (String)
The ID of the control to receive focus.
Remarks
The SetFocus method works like the SetFocus(String) method for the Page class. Both methods make the control with the specified ID 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(String) 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)