2013-02-25 38 views
1

我有一個特定的頁面,我想在按鈕點擊事件,並在某些條件下禁用所有的控件和grayout整個頁面,顯示一條信息消息,說明確認完成。如何在後臺代碼的某些情況下禁用整個頁面?


如何以一般方式做到這一點?

+2

聽起來像你想的fancybox ... HTTP: //fancyapps.com/fancybox/ – 2013-02-25 12:39:15

+2

通常您可以使用覆蓋您所有頁面的div。就像Jquery Modal Dialog確認一樣。或純JavaScript。 – Freeman 2013-02-25 12:39:16

+0

然後我用父div包圍我的控件後? – 2013-02-25 12:40:44

回答

0

你可以讓所有的控制 「invisble」 用戶點擊後

foreach (Control c in Page.Controls) 
     c.Visible = false; 

或者更好的辦法是在HTML中使用插件,如Modal-UpdateProgress

0

<div id="layer"></div> 
<div id="container"> 

    ---- 
    ---- 
    ---- 

</div> 

,並在CSS

#layer{ 
    background: none repeat scroll 0 0 white; 
    height: 100%; 
    left: 0; 
    position: fixed; 
    top: 0; 
    width: 100%; 
    z-index: 100000; 
} 

這將禁用頁面(或者它會像禁用一樣)。

1
$(document).ready(function() { 
if(Conditions satisfy){ 
    $('#div_controls').attr('disabled', true); 
    $('#div_status').attr('disabled', false);} 
else{ $('#div_controls').attr('disabled', false); 
    $('#div_status').attr('disabled', True) 
} 

}); 

In HTML 

<div id="div_status"> Your Message with your styles </div> 
<div id="div_controls"> Your Controls inside this Div </div> 

無需任何後回,WO丟失數據,狀態這是可以做到..

或查看演示

http://www.zurb.com/playground/reveal-modal-plugin

相關問題