0

我已经编写了一个代码来打开一个页面作为模式弹出窗口。它工作正常。但是当页面作为对话框打开并且我单击打开页面的 asp 按钮时,它会导致页面在窗口中生成..并且父页面消失......我该如何解决问题,以便如果我进行回发在弹出页面中,它也应保留为主页中的弹出窗口。

当我单击 Payment_Delivery_Scheduling.aspx 中的按钮时,它会导致页面重定向到浏览器中的该页面。

function openPaymentAndDeliveryModel(id) {
            var windowWidth = $(window).width() / 1.25;
            var windowHeight = $(window).height() /1.5;
            $('#popup').load("Payment_Delivery_Scheduling.aspx?id=" + id + "", function () {

            });
            $('#popup').dialog({ modal: true, height: windowHeight, width: windowWidth });
        }
4

1 回答 1

0

嘿 Sachin 示例代码是

 $("#btnSubmit").live("click", function (e) {
    if ($('#txtPwd').val().length < 1) {
        $('#lblResponse').text('Please enter password to move ahead.').addClass("fail-message"); ;
        $('#txtPwd').focus();
    } else {
        callAjax($('#txtPwd').val());
        e.preventDefault();
    }
});

function callAjax(hashVal) {
var address = "Home.aspx";
$.ajax({
    type: 'POST',
    url: address,
    data: { pwd: hashVal },
    beforeSend: function () {
        // this is where we append a loading image
        $('#ajax-panel').html('<div class="loading"><img src="images/loading.gif" alt="Loading..." /></div>');
    },
    success: function (data) {
        // successful request; do something with the data
        $('#ajax-panel').empty();
        var actualData = data.trim().split('~');

        $("#lblResponse").html(actualData[0]);
        $('#txtPwd').val('');
        if (actualData[1] == "true") {
           window.location.href = window.referer = $('#lnkMyCorner').attr('href');
        }

    },
    error: function () {
        // failed request; give feedback to user
        $('#ajax-panel').html('<p class="error"><strong>Oops!</strong> Try that again in a few moments.</p>');
    }
});
}

希望对你有帮助

于 2013-05-07T10:23:59.953 回答