Skip to main content
A newer version of this page is available. .
Tab

ASPxPopupMenu.PopupElementResolve Event

Allows an object specified by the ASPxPopupMenu.PopupElementID property to be found manually, if it can’t be found automatically (if it’s hidden within a naming container, for instance).

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v18.2.dll

Declaration

public event EventHandler<ControlResolveEventArgs> PopupElementResolve

Event Data

The PopupElementResolve event's data class is ControlResolveEventArgs. The following properties provide information specific to this event:

Property Description
ControlID Gets the ID value of a control that should be resolved.
ResolvedControl Gets or sets the control relating to the event.

Remarks

The PopupElementResolve event occurs when the hierarchically-qualified identifier of a control specified by the ASPxPopupMenu.PopupElementID property is queried during popup menu rendering.

If the specified object cannot be found within a web page in a standard manner (for instance, it is contained within a naming container such as an ASPxRoundPanel, or there is more than one object with the same ID on the page - within UserControl objects), you should handle the PopupElementResolve event to obtain the required object manually.

The PopupElementResolve event argument’s parameters allow you to identify the control that should be found (the ControlResolveEventArgs.ControlID property) and point out the resolved control (the ControlResolveEventArgs.ResolvedControl property).

Example

This example demostrates how the ASPxPopupMenu.PopupElementResolve event can be handled to resolve an ASPxTextBox object contained within an ASPxRoundPanel control.

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>

<%@ Register Assembly="DevExpress.Web.v8.3, Version=8.3.2.0, Culture=neutral, 
PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dxe" %>
<%@ Register Assembly="DevExpress.Web.v8.3, Version=8.3.2.0, Culture=neutral, 
PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxRoundPanel" TagPrefix="dxrp" %>  
<%@ Register Assembly="DevExpress.Web.v8.3, Version=8.3.2.0, Culture=neutral, 
PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxPanel" TagPrefix="dxp" %> 
<%@ Register Assembly="DevExpress.Web.v8.3, Version=8.3.2.0, Culture=neutral, 
PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxMenu" TagPrefix="dxm" %> 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">
    protected void ASPxPopupMenu1_PopupElementResolve(object sender, 
         DevExpress.Web.ControlResolveEventArgs e) {
        e.ResolvedControl = ASPxRoundPanel1.FindControl(e.ControlID);
    }
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
        <dxrp:ASPxRoundPanel ID="ASPxRoundPanel1" runat="server" Width="200px">
            <PanelCollection>
                <dxp:PanelContent ID="PanelContent1" runat="server">
                    <dxe:ASPxTextBox ID="ASPxTextBox1" runat="server" Width="170px">
                    </dxe:ASPxTextBox>
                </dxp:PanelContent>
            </PanelCollection>
        </dxrp:ASPxRoundPanel>

        <dxm:ASPxPopupMenu ID="ASPxPopupMenu1" runat="server" PopupAction="MouseOver"
         PopupElementID="ASPxTextBox1" OnPopupElementResolve="ASPxPopupMenu1_PopupElementResolve">
            <Items>
                <dxm:MenuItem Text="Item1"></dxm:MenuItem>
                <dxm:MenuItem Text="Item2"></dxm:MenuItem>
            </Items>
        </dxm:ASPxPopupMenu>
    </form>
</body>
</html>
See Also