asp.net防止頁面重新整理彈出“需要重新發送您以前提交的資訊”

來源:互聯網
上載者:User

子表單重新整理父表單時,彈出討厭的對話方塊,“需要重新發送您以前提交的資訊”

解決方案,在子表單關閉時

代碼:

window.document.execCommand('Refresh');

 

父表單的Forms標記method="GET"

 <form id="form1" runat="server" method="GET">

 

文章來自己Jquery彈出子表單時,重新整理父表單

ASP.NET整合fancybox彈出頁面執行個體講解

 

fancybox:http://fancybox.net/ 前台代碼:在ASPX頭部加入下列語句:<script src="../js/jquery-1.4.2.min.js" type="text/javascript"></script><script src="../js/jquery.mousewheel-3.0.4.pack.js" type="text/javascript"></script><script src="../js/jquery.fancybox-1.3.4.js" type="text/javascript"></script>接著寫入下列script語句:<script type="text/javascript">$(document).ready(function(){      $('a.newBtn').each(function(index)    {        $(this).fancybox({            'width' : '95%',            'height' : '95%',            'type' : 'iframe',            'hideOnOverlayClick' : false,            'onCleanup' : function() { return confirm('Are you sure to close this dialog?All data will be lost if not save.');},            'onClosed' : function() { window.location.href = 'index.aspx';}        });    });});</script>a.newBtn對應控制項如下:<a class="newBtn" href="edit.aspx">Add New</a>這裡的edit.aspx中可以加入參數。如edit.aspx?id=1等。這樣點擊Add New後,edit.aspx頁面就會彈出來了。如何在彈出來的fancybox頁面上點擊Close按鈕關閉它?parent.$.fancybox.close();http://stackoverflow.com/questions/1829319/close-fancy-box-from-function-from-within-open-fancybox如何在彈出來的fancybox頁面上點擊Close按鈕重新整理父頁面?window.parent.document.execCommand('Refresh');如何在當前版面設定關閉fancybox頁面後重新整理此頁面?$('a#editCatalog').fancybox({                 'width': '80%',                 'height': '80%',                 'type': 'iframe',                 'hideOnOverlayClick': false,                 'onClosed': function() {                        window.document.execCommand('Refresh');                 }             }); 將refresh這句話寫在“onClosed”的好處就是在彈出頁面中,無論點擊“Close”按鈕,還是點擊右上方的“Close”表徵圖關閉彈出頁面,都會運行到onClosed這裡。經實驗,發現在IE下沒問題,在FF下就不行。修改代碼為:window.document.location.reload(true);即可。

  

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.