jQuery模态对话框不等待用户输入

时间:2018-06-23 02:22:19

标签: modal-dialog imagebutton aspxgridview

我在Gridview中有一个Imagebutton,单击Imagebutton后需要获得用户确认。根据输入,我应继续执行流程(如果确定,请导航至下一页,否则留在同一页面上)

下面是我的代码示例

function confirmClose(buttonID)
{
    var flagProceed = false;
    $("#light").dialog({
        resizable: false,
        height: "auto",
        width: "800",
        modal: true,
        buttons: {
            "Proceed": function () {
                $(this).dialog("close");
                flagProceed = true;
                return flagProceed;
            },
            Cancel: function () {
                $(this).dialog("close");
                flagProceed = false;
                return flagProceed;


            }
        }
    });
    return flagProceed;

    /* 
    If i return true here, when i click imagebutton modal appears and immediately page 
    navigate away without waiting for user input, if returning false it shows modal dialog and 
    if I click ok/Cancel only modal dialog closing no navigating to next page. 
    */             
}

请注意,正常的javascript确认工作正常,但我的客户希望使用图片和字体格式发出警报(因此我使用了Div元素) 我尝试了很多技巧,但没有任何帮助。请帮我。

0 个答案:

没有答案
相关问题