This is a migrated thread and some comments may be shown as answers.

RadContextMenu not firing Ajax Modal Popup Extender

1 Answer 35 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Paul asked on 19 Feb 2019, 04:28 PM


I have a split button and RadContextMenu, however for the life of me cannot get the MPE to fire from the Context items and its driving me up the wall. Can anyone please help point me in the right direction.

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ShowModal.aspx.cs"
    Inherits="Default" %>
<%@ Register Namespace="AjaxControlToolkit" TagPrefix="AjaxControlToolkit" Assembly="AjaxControlToolkit" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<head runat="server">
    <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        <telerik:RadButton EnableSplitButton="true" ID="btnPOSplitBtn" runat="server" Text="Search"
        <telerik:RadContextMenu ID="POActionsMenu" runat="server" OnItemClick="POActionsMenu_ItemClick">
                <telerik:RadMenuItem Text="Export CSV" Value="3">
                <telerik:RadMenuItem Text="Change Status to Printed" Value="4">
                <telerik:RadMenuItem Text="Delete Purchase Order" Value="5">
        <%-- Alert Box --%>
        <asp:LinkButton ID="lnkConfirm" runat="server"></asp:LinkButton>
        <AjaxControlToolkit:ModalPopupExtender ID="mpeConfirm" runat="server" DropShadow="false" PopupControlID="pnlConfirm" TargetControlID="lnkConfirm" BackgroundCssClass="modalBackground" BehaviorID="Confirmations" CancelControlID="btnCloseConfirm">
        <asp:Panel ID="pnlConfirm" runat="server" CssClass="modalPopup" Style="display: none; width: 80%; max-height: 80%; overflow-y: auto;">
            <h2>Are you sure?</h2>
                <asp:Label ID="lblConfirmAlert" runat="server"></asp:Label>
            <telerik:RadButton ID="btnConfirmClose" runat="server" Text="No - Close" UseSubmitBehavior="false" />
        <telerik:RadScriptBlock runat="server">
            <script type="text/javascript">
                function OnClientClicked(sender, args) {
                    if (args.IsSplitButtonClick()) {
                        var currentLocation = $telerik.getLocation(sender.get_element());
                        var contextMenu = $find("<%=POActionsMenu.ClientID%>");
                        contextMenu.showAt(currentLocation.x + 75, currentLocation.y + 32);
                    else {


and my code behind.

using System;
using Telerik.Web.UI;
public partial class Default : System.Web.UI.Page
    protected void Page_Load(object sender, EventArgs e)
    protected void POActionsMenu_ItemClick(object sender, RadMenuEventArgs e)
        RadContextMenu btn = (RadContextMenu)(sender);
        string value = btn.SelectedValue;
        switch (value)
            //View PO
            case "1":
            //Send me a copy
            case "2":
            //Export CSV
            case "3":
            //Change status to printed
            case "4":
                //   btnConfirmYes.CommandArgument = "Change to Printed";
            //Delete po
            case "5":
                //    btnConfirmYes.CommandArgument = "Delete PO";
                // deletePO();


Thanks in advance, its driving me crazy as it hits the event but never shows. (CSS not included)

1 Answer, 1 is accepted

Sort by
Top achievements
Rank 1
answered on 20 Feb 2019, 03:07 PM


Weirdly, recreating the modal popup with different control names fixed the issue and all working.

Asked by
Top achievements
Rank 1
Answers by
Top achievements
Rank 1
Share this question