Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/75.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery Asp.net Ajax选项卡容器,切换选项卡时提示保存_Jquery_Asp.net Ajax_Tabcontainer - Fatal编程技术网

Jquery Asp.net Ajax选项卡容器,切换选项卡时提示保存

Jquery Asp.net Ajax选项卡容器,切换选项卡时提示保存,jquery,asp.net-ajax,tabcontainer,Jquery,Asp.net Ajax,Tabcontainer,好的,我有一个页面,我们在一个Ajax选项卡容器中使用表单。在选项卡之间切换时,我正在清除表单字段。我想提示用户保存页面上的任何更改。这是相当好的工作,除了标签改变之前,JavaScript弹出。因此,如果他们选择取消,他们已经在新选项卡上。我希望他们只在按“确定”时更改到新选项卡,如果他们单击“取消”,它将保留在当前页面上 下面是我用于保存提示的jQuery $(function () { $(':input').bind('change', function () { setConfirmU

好的,我有一个页面,我们在一个Ajax选项卡容器中使用表单。在选项卡之间切换时,我正在清除表单字段。我想提示用户保存页面上的任何更改。这是相当好的工作,除了标签改变之前,JavaScript弹出。因此,如果他们选择取消,他们已经在新选项卡上。我希望他们只在按“确定”时更改到新选项卡,如果他们单击“取消”,它将保留在当前页面上

下面是我用于保存提示的jQuery

$(function () {
$(':input').bind('change', function () { setConfirmUnload(true); }); // Prevent accidental navigation away
$('.noprompt-required').click(function () { setConfirmUnload(false); });
$('.buttons').click(function () { setConfirmUnload(false); });

function setConfirmUnload(on) {
    window.onbeforeunload = (on) ? unloadMessage : null;
}

function unloadMessage() {
    return 'You have entered new data on this page.  If you navigate away from this page without first saving your data, the changes will be lost.';
}

window.onerror = UnspecifiedErrorHandler;

function UnspecifiedErrorHandler() {
    return true;

}

}); 
非常感谢您的帮助。谢谢