asp.net 离开页面提示

<script language="javascript" type="text/javascript">

        function StartProgressBar() {
            ShowConfirmClose(false);
            var myExtender = $find('ModalPopupExtender1');

            myExtender.show();

            return true;

        }
        var pb_strConfirmCloseMessage;
        var pb_blnCloseWindow = false;
        pb_strConfirmCloseMessage = "您确定要放弃本页结果吗?";
        function ConfirmClose() {
            window.event.returnValue = pb_strConfirmCloseMessage;
            pb_blnCloseWindow = true;
        }
        function ShowConfirmClose(blnValue) {
            if (blnValue) {
                document.body.onbeforeunload = ConfirmClose;
            } else {
                document.body.onbeforeunload = null;
            }
        }
        function confirmCancel() {
            ShowConfirmClose(false);
            confirm("确定取消编辑平台吗?");
        }
</script>

 

posted @ 2013-05-13 16:06  louiskoo  阅读(404)  评论(0编辑  收藏  举报