【问题标题】:Display ASPX Popup control in RowDeleteing Event (ASPX Gridview)在 RowDeleting 事件 (ASPXGridview) 中显示 ASPX 弹出控件
【发布时间】:2015-10-11 17:22:17
【问题描述】:

我有一个包含新建和删除按钮的 ASPXGridview。 Delete 按钮包含一个 gv_RowDeleting 事件。 我想显示 AspxPopupControl (ID="pupConfirm")。我希望用户必须确认密码才能删除项目。 我试过了:

protected void gv_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e)
{
    pupConfirm.ShowOnPageLoad = true;
}

但是什么也没发生。请帮我。谢谢!!!

【问题讨论】:

    标签: c# asp.net gridview webforms


    【解决方案1】:

    您可以使用 javascript 创建模板列以提示确认。

    <ItemTemplate>
        <asp:LinkButton ID="btnDelete" runat="server" Text="Delete" CommandName="Delete" 
                        OnClientClick="javascript:if(!confirm('Are you sure you want to delete this record?')){return false;}">
        </asp:LinkButton>
    </ItemTemplate>
    

    【讨论】:

    • 嗨,感谢支持,但我想显示一个弹出窗口(ASPX Popupcontrol)让用户输入他/她的密码来删除项目
    【解决方案2】:

    使用模态弹出窗口。您可以在此处查看代码和演示: Building Modal Popup using ASP.Net AJAX ModalPopupExtender Control

    【讨论】:

    • 是的,它是如此美丽的弹出窗口。但我不知道我可以在 ASPX Gridview 中使用什么事件来使用此 Modal Popup 如我所见,事件单击按钮是这样的:&lt;asp:Button ID="btnShow" runat="server" Text="Show Modal Popup" /&gt; 我想我必须在 ASPXGridview 中使用 customButtonclick 事件,对吧?再次感谢我的朋友! @Kio Fujiwara
    • 您可以使用modalpopup.show()打开按钮事件或c#代码中的任何事件中的模态弹出窗口。
    猜你喜欢
    • 2015-10-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-01-24
    • 1970-01-01
    相关资源
    最近更新 更多