1

please help me in creating a alert before deleting a row in gridview, as for my requirement i created a grid in ascx page and calling in aspx page. I have a LinkButton for deleting and the functionality is working fine but i'm unable to get a popup warning before delete. If i use "return confirmation('alert before delete')" it's working fine, instead of alert i need a popup

please help me thanks

sumanth
  • 53
  • 6

2 Answers2

0

Try to bind an event to that links using,

$(document).on("click", ".classnameoflink", function () { 
    //code for pop up 

    });

Edit

$(document).on("click", ".DeleteUserRow", function() {
$("#message").html("Are you sure you want to delete User?");
$("#dialog").dialog({
    title: "Delete Confirmation",
    buttons: {
        Ok: function () {},
        Cancel: function () {
            $(this).dialog('close');
            return false;
        }
    },
    modal: true
});
});

make sure that, DeleteUserRow is the same rendered class name of that link button.

Anoop Joshi P
  • 25,373
  • 8
  • 32
  • 53
0

Please check this Link it many help you.

I am using 3 buttons instead of using 3 button you can use Ok and Cancel.

Community
  • 1
  • 1
Rocky
  • 4,454
  • 14
  • 64
  • 119