Back to Devexpress

ASPxPanelBase.DefaultButton Property

aspnet-devexpress-dot-web-dot-aspxpanelbase-d21c0477.md

latest2.7 KB
Original Source

ASPxPanelBase.DefaultButton Property

Gets or sets the identifier for the default button that is contained in the panel control.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
[DefaultValue("")]
public string DefaultButton { get; set; }
vb
<DefaultValue("")>
Public Property DefaultButton As String

Property Value

TypeDefaultDescription
StringString.Empty

A string value corresponding to the ID for a button control contained in the panel.

|

Remarks

Use the DefaultButton property to indicate which button is clicked when the panel control has focus and the user presses the ENTER key.

Note

The DefaultButton property works when it is possible to focus a panel. To be able to focus the panel, assign the TabIndex property for the panel.

Example

The complete sample project is available in the DevExpress Code Central database at E347.

aspx
<dxp:ASPxPanel ID="ASPxPanel1" runat="server" DefaultButton="ASPxButton1" Width="200px">
    <PanelCollection>
        <dxp:PanelContent runat="server">
            <dxe:ASPxTextBox ID="ASPxTextBox1" runat="server" Width="170px" 
                Text="test value" ClientInstanceName="ASPxTextBox1" />
                

                <dxe:ASPxButton ID="ASPxButton1" runat="server" AutoPostBack="False" 
                    Text="Return To Parent Page">
                <ClientSideEvents Click="ReturnToParentPage" />
            </dxe:ASPxButton>
        </dxp:PanelContent>
    </PanelCollection>
</dxp:ASPxPanel>

See Also

DefaultButtonResolve

Panel

Form Submission

ASPxPanelBase Class

ASPxPanelBase Members

DevExpress.Web Namespace