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

Hey 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 に答える