Friday, September 7, 2012

Confirmation Message While deleting a record from gridview in asp.net

<script type="text/javascript">

function confirmationBox() {
            var r = confirm("Are you sure you want to delete? Click Ok to continue");
            if (r) {
                return true;
            }
            else {
                return false;
            }
        }

</script>


<asp:LinkButton ID="lbtnDelete" runat="server" Text="Delete"
                                        CommandArgument='<%# Eval("ID") %>' CommandName="Delete" OnClientClick="return confirmationBox();"></asp:LinkButton>


// this is for Confirmation Message While deleting a record from gridview or listview, if you say confirm it will delete the record,otherwise if we select cancel it shouldn't delete a record in asp.net

No comments:

Post a Comment

Comments

Protected by Copyscape Plagiarism Software