thanhhuy12thh
thanhhuy12thh

Reputation: 41

Display ASPX Popup control in RowDeleteing Event (ASPX Gridview)

I have an ASPXGridview that includes a New and Delete button. The Delete button includs a gv_RowDeleting event. I want to show AspxPopupControl (ID="pupConfirm"). I want the user to have to confirm the password to delete an item. I tried:

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

But nothing happened. Please help me. Thanks !!!

Upvotes: 2

Views: 735

Answers (2)

Hakunamatata
Hakunamatata

Reputation: 1275

You can create a template column with javascript to prompt for confirmation.

<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>

Upvotes: 2

Kio.
Kio.

Reputation: 23

Use Modal PopUp. You can see code and demo here: Building Modal Popup using ASP.Net AJAX ModalPopupExtender Control

Upvotes: 0

Related Questions