Skip to main content

ASPxWebControl.Focus() Method

Sets input focus to the web control.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v22.1.dll


public override void Focus()


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(); }"
See Also