Tab

ASPxWebControl.Focus() Method

Sets input focus to the web control.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v20.2.dll

Declaration

public override void Focus()
Public Overrides Sub Focus

Remarks

On mobile devices, the Focus method does not invoke the keyboard, because it can be displayed in response to user actions only. For instance, you can focus a text box in a user-generated event handler, such as a button click.

The code sample below demonstrates how to focus a text box and display the keyboard in code.

<dx:ASPxTextBox runat="server" ID="ASPxTextBox1" ClientInstanceName="textBox" />
<dx:ASPxButton ID="ASPxButton1" runat="server" Text="ASPxButton" AutoPostBack="false">
    <ClientSideEvents Click="function(s, e) { textBox.SetFocus(); }"
</dx:ASPxButton>
See Also