Skip to main content

Bootstrap Delete Confirmation popup


<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Bootstrap Popup message</title>
    <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
    <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" />
    <script type="text/javascript">
        function getConfirmation(sender, title, message) {
            $("#ModalTitle").text(title);
            $("#ModalMsg").text(message);
            $('#modalPopUp').modal('show');
            return false;
        }
    </script>

    <style type="text/css">
        i {
            color: #ffffff;
        }

        .btnRound {
            border-radius: 15px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <div id="modalPopUp" class="modal fade" role="dialog">
                <div class="modal-dialog">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal">&times;</button>
                            <h4 class="modal-title">
                                <span id="ModalTitle"></span>
                            </h4>
                        </div>
                        <div class="modal-body">
                            <p>
                                <span id="ModalMsg"></span>.
                            </p>
                        </div>
                        <div class="modal-footer">

                            <div class="col-md-3 col-md-offset-6 col-sm-4 col-sm-offset-4 col-xs-4 col-xs-offset-3">
                                <div class="form-group">
                                    <div class="has-feedback">
                                        <asp:Button ID="btnNo" data-dismiss="modal" CssClass="btn btn-danger btnRound" Width="100%" runat="server" Text="No" />
                                        <i class="glyphicon glyphicon-remove form-control-feedback"></i>
                                    </div>
                                </div>
                            </div>
                            <div class="col-md-3 col-sm-4 col-xs-5">
                                <div class="form-group">
                                    <div class="has-feedback">
                                        <asp:Button ID="btnYes" CssClass="btn btn-success btnRound" Width="100%" runat="server" Text="Yes, do" />
                                        <i class="glyphicon glyphicon-ok form-control-feedback"></i>
                                    </div>
                                </div>
                            </div>


                        </div>
                    </div>
                </div>
            </div>


            <br />
            <div class="col-md-2 col-md-offset-5 col-sm-2 col-sm-offset-5 col-xs-4 col-xs-offset-4">
                <div class="form-group">
                    <div class="has-feedback">
                        <asp:Button ID="lnkDelete" runat="server" Text="Delete" CssClass=" form-control btn btn-danger btnRound"
                            OnClientClick="return getConfirmation(this, 'Please confirm to Delete','Are you sure you want to delete?');" />
                        <i class="glyphicon glyphicon-trash form-control-feedback "></i>
                    </div>
                </div>
            </div>


        </div>
    </form>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</body>
</html>

:) Output ******
















Comments

Popular posts from this blog

How to get Reverse Of a number in C# ?

Reverse of a positive integer integer  number in c#  Program : using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Reverse {     class Program     {         static void Main( string [] args)         {             int num, rem, rev = 0;             Console .WriteLine( "//How to get Reverse of a number in c# ?" );             Console .WriteLine( "Enter A number :" );             num = Convert .ToInt32( Console .ReadLine());             if (num > 0)     ...

How to find sum of the digits of a number in c#?

Sum of the Digits of a number Program: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApplication1 {     class Program     {         static void Main( string [] args)         {             int num, sum = 0;             Console .WriteLine( "Enter a number :\n" );             num = Convert .ToInt32( Console .ReadLine());             if (num > 0)             {                 for ( int temp = num; tem...

How to check a number Prime or not in c# ?

/*Check a number Prime or not in C# */ Program : using  System; using  System.Collections.Generic; using  System.Linq; using  System.Text; using  System.Threading.Tasks; namespace  Primenumber {      class   Program     {          static   void  Main( string [] args)         {              int  num, flag = 0;              Console .WriteLine( "Enter A number :" );             num =  Convert .ToInt32( Console .ReadLine());              if  (num > 0)             {  ...