Automatically Jquery close alert /dialog box


Automatically Jquery close alert /dialog box 

//Add below html code into body
<div id="dialog1" title="Alert Message" style="display:none">
    <asp:Label ID="lblMessage" runat="server" Text="Record Inserted Successfully"></asp:Label>
</div>

//add below code into head
<script type="text/javascript">
        function DisplayPOP() {
            var mydiv = $('#dialog1');
            mydiv.css('display', 'block');
            mydiv.dialog({ autoOpen: false, height: 20, width: 300 });
            mydiv.dialog('open');
            //send the time
            AutoCloseDialogBox(3000);
            return false;

        }

        function AutoCloseDialogBox(WaitSeconds) {
            setTimeout(function () { $("#dialog1").dialog("close"); }, WaitSeconds);
        }
 </script>

Comments

Popular posts from this blog

Display multiple marker point on Google Map with same location or same Longitude,Latitude

How to refresh parent page on close of popup window by toolbar close button

Implementing Zoom functionality in asp.net