页面更改时弹出窗口无效

时间:2016-05-09 09:16:09

标签: javascript ajax asp.net-mvc asp.net-mvc-3 asp.net-mvc-4

我有一个通过表中的ajax调用的弹出窗口,它一直有效,直到调用更改表中数据的新查询。然后它不起作用,但也不会触发Ajax错误(转到Ajax成功)。

我的JavaScript



<script type="text/javascript">
    var theDialog = $('#my-dialog').dialog({
        autoOpen: false,
        modal: true,
        closeOnEscape: false,
        height: screen.availHeight - 100, 
        width: 1100,
        show: 'fade',
        hide: 'fade',
        resizable: 'false'
    });
    var myDialogProgress = $('#my-dialog-progress');
    var myDialogContent = $('#my-dialog-content');
   
    function showEventRegistrantSummary(id, ui) {
        $.ajaxSetup({ cache: false });
        myDialogProgress.show();
        theDialog.dialog('open');
        myDialogContent.html('');

        $.ajax({
            url: 'Home/Popup?id=' + id + '&ui=' + ui,
            type: 'GET',
            cache: false,
            dataType: 'html',
            success: function (data) {
                myDialogProgress.hide();
                myDialogContent.html(data);
            },
            error: function (XMLHttpRequest, textStatus, errorThrown) {
                alert("Estado: " + textStatus); alert("Error: " + errorThrown);
            }
        });        
    }
</script>
&#13;
&#13;
&#13;

0 个答案:

没有答案