How to disable the background window
<p>I want to disable the background window when clicking the button. In my project I am using update panel and progress bar. when I click the button the background window is fully visible= false. I want to disable the background window and the progress bar should be displayed. Here is the code:</p>

<pre><code>&lt;%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="fp_t012stk.aspx.vb" Inherits="fp_t012stk" title="Current Stock Report" %&gt;

&lt;%@ Register Assembly="CrystalDecisions.Web, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"

    Namespace="CrystalDecisions.Web" TagPrefix="CR" %&gt;

&lt;%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %&gt;

&lt;asp:Content ID="Content1"  ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"&gt;

&lt;script type="text/JavaScript" language="JavaScript"&gt;

function ShowProgress()

    {





   document.getElementById ('MainDiv').style.display='';

    document.getElementById ('MainDiv').style.visibility='visible';

    document.getElementById ('MainDiv').style.position='absolute';

    document.getElementById ('MainDiv').style.top='0px';

    document.getElementById ('MainDiv').style.left='0px';

    document.getElementById ('MainDiv').style.width= '100%';

    document.getElementById ('MainDiv').style.height= '100%';

    document.getElementById ('MainDiv').style.backgroundColor = "Gray";

    document.getElementById ('MainDiv').style.filter = "alpha(opacity=60)";

    document.getElementById ('MainDiv').style.opacity = "0.6";

    document.getElementById('&lt;% Response.Write(UpdateProgress1.ClientID)%&gt;').style.display = "inline";

    document.getElementById ('MainDiv').style.display='none';

    document.getElementById ('MainDiv').style.visibility='visible';

    document.getElementById ('MainDiv').style.top='0px';

    document.getElementById ('MainDiv').style.left='0px';

    document.getElementById ('MainDiv').style.width= '0px';

    document.getElementById ('MainDiv').style.height= '0px';



   }   

  &lt;/script&gt;



 &lt;div id="MainDiv"&gt;

 &lt;asp:ScriptManager id="ScriptManager1" AsyncPostBackTimeout="0" runat="server"&gt;

    &lt;/asp:ScriptManager&gt;



    &lt;asp:UpdatePanel id="UpdatePanel1" runat="server"&gt;

        &lt;contenttemplate&gt;

&amp;nbsp; &lt;TABLE cellSpacing=0&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD colSpan=3&gt;

&lt;HR class="css_horizontalruleUp" /&gt;

&lt;TABLE cellSpacing=0&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD align=right&gt;&lt;asp:Label id="Label1" runat="server" CssClass="css_HeaderLabel" __designer:wfdid="w118" Text="Current Stock" Width="100px"&gt;&lt;/asp:Label&gt;&lt;/TD&gt;&lt;TD&gt;&lt;asp:Panel id="Panel1" runat="server" CssClass="css_panel" __designer:wfdid="w119" BackColor="White"&gt;&amp;nbsp;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD align=right&gt;&lt;asp:Label id="Label3" runat="server" CssClass="css_normalLabel" __designer:wfdid="w120" Text="*Product Family" Width="90px"&gt;&lt;/asp:Label&gt;&lt;/TD&gt;&lt;TD style="WIDTH: 100px" align=left&gt;&lt;asp:DropDownList id="droProdFamily" runat="server" CssClass="css_dropdown" __designer:wfdid="w121" Width="275px" AutoPostBack="True"&gt;

                                            &lt;/asp:DropDownList&gt;&lt;/TD&gt;&lt;TD style="WIDTH: 148px" align=right&gt;&lt;asp:Label id="Label5" runat="server" CssClass="css_normalLabel" __designer:wfdid="w122" Text="*Product:"&gt;&lt;/asp:Label&gt;&lt;/TD&gt;&lt;TD align=left colSpan=5&gt;&lt;asp:DropDownList id="droProduct" runat="server" CssClass="css_dropdown" __designer:wfdid="w123" Width="275px"&gt;

                                            &lt;/asp:DropDownList&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align=right&gt;&lt;asp:Label id="Label7" runat="server" CssClass="css_normalLabel" __designer:wfdid="w124" Text="*Branch:" Width="1px"&gt;&lt;/asp:Label&gt;&lt;/TD&gt;&lt;TD align=left&gt;&lt;asp:DropDownList id="Drp_Branch" runat="server" CssClass="css_dropdown" __designer:wfdid="w125" Width="272px" AutoPostBack="True"&gt;

                                            &lt;/asp:DropDownList&gt;&lt;/TD&gt;&lt;TD style="WIDTH: 148px" align=left&gt;&lt;/TD&gt;&lt;TD align=left&gt;&lt;/TD&gt;&lt;TD align=left&gt;&lt;/TD&gt;&lt;TD align=left&gt;&lt;/TD&gt;&lt;TD align=left&gt;&lt;/TD&gt;&lt;TD align=left&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align=right&gt;&lt;asp:Label id="Label4" runat="server" CssClass="css_normalLabel" __designer:wfdid="w126" Text="*Warehouse:" Width="90px"&gt;&lt;/asp:Label&gt;&lt;/TD&gt;&lt;TD align=left&gt;&lt;asp:DropDownList id="Drp_Ware_CD" runat="server" CssClass="css_dropdown" __designer:wfdid="w127" Width="275px" AutoPostBack="True"&gt;

                                            &lt;/asp:DropDownList&gt;&lt;/TD&gt;&lt;TD style="WIDTH: 148px" align=right&gt;&lt;asp:Label id="Label2" runat="server" CssClass="css_normalLabel" __designer:wfdid="w128" Text="*Stock Type:" Width="75px"&gt;&lt;/asp:Label&gt;&lt;/TD&gt;&lt;TD align=left&gt;&lt;asp:DropDownList id="Drp_Stk_Type" runat="server" CssClass="css_dropdown" __designer:wfdid="w129" Width="93px"&gt;

                                                &lt;asp:ListItem&gt;All&lt;/asp:ListItem&gt;

                                                &lt;asp:ListItem Value="G"&gt;Good&lt;/asp:ListItem&gt;

                                                &lt;asp:ListItem Value="D"&gt;Defective&lt;/asp:ListItem&gt;

                                                &lt;asp:ListItem Value="A"&gt;OOW Good&lt;/asp:ListItem&gt;

                                                &lt;asp:ListItem Value="B"&gt;OOW Defective&lt;/asp:ListItem&gt;

                                            &lt;/asp:DropDownList&gt;&lt;/TD&gt;&lt;TD align=left&gt;&amp;nbsp;&lt;asp:Label id="Label8" runat="server" CssClass="css_normalLabel" __designer:wfdid="w130" Text=" Serial # Required ?:" Width="115px"&gt;&lt;/asp:Label&gt;&lt;/TD&gt;&lt;TD align=left&gt;&lt;asp:DropDownList id="Drp_Uslno_ID" runat="server" CssClass="css_dropdown" __designer:wfdid="w131"&gt;

                                                &lt;asp:ListItem Value="N"&gt;No&lt;/asp:ListItem&gt;

                                                &lt;asp:ListItem Value="Y"&gt;Yes&lt;/asp:ListItem&gt;

                                            &lt;/asp:DropDownList&gt;&lt;/TD&gt;&lt;TD align=left&gt;



                                            &lt;asp:Button id="btnReport" runat="server" CssClass="css_button" __designer:wfdid="w132" Text="PRINT" OnClientClick="ShowProgress()"&gt;&lt;/asp:Button&gt;&lt;/TD&gt;&lt;TD align=left&gt;&lt;asp:Button id="btnExcel" runat="server" CssClass="css_button" __designer:wfdid="w133" Text="Excel"&gt;&lt;/asp:Button&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/asp:Panel&gt; &lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;

&lt;HR class="css_horizontalruleDown" /&gt;

&lt;asp:Label id="lblmsg" tabIndex=-1 runat="server" ForeColor="Red" Font-Bold="True" CssClass="css_MessageLabel" __designer:wfdid="w134"&gt;&lt;/asp:Label&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="HEIGHT: 14px" colSpan=3&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align=left colSpan=3&gt;&amp;nbsp;&lt;TABLE cellSpacing=0 cellPadding=0&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;CR:CrystalReportViewer id="CrystalReportViewer1" runat="server" ReportSourceID="CrystalReportSource1" AutoDataBind="true" __designer:wfdid="w135" DisplayGroupTree="False" EnableDatabaseLogonPrompt="False" HasCrystalLogo="False" HasDrillUpButton="False" HasExportButton="False" HasGotoPageButton="False" HasPageNavigationButtons="False" HasSearchButton="False" HasToggleGroupTreeButton="False" HasViewList="False" HasZoomFactorList="False"&gt;&lt;/CR:CrystalReportViewer&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;

&lt;/contenttemplate&gt;

        &lt;triggers&gt;

&lt;asp:PostBackTrigger ControlID="btnReport"&gt;&lt;/asp:PostBackTrigger&gt;

&lt;asp:PostBackTrigger ControlID="btnExcel"&gt;&lt;/asp:PostBackTrigger&gt;

&lt;/triggers&gt;

    &lt;/asp:UpdatePanel&gt;

    &lt;CR:CrystalReportSource ID="CrystalReportSource1" runat="server"&gt;

        &lt;Report FileName="rp_t012stk.rpt"&gt;

        &lt;/Report&gt;

    &lt;/CR:CrystalReportSource&gt;

    &lt;CR:CrystalReportPartsViewer ID="CrystalReportPartsViewer1" runat="server" AutoDataBind="true"

        ReportSourceID="CrystalReportSource1" /&gt;

 &lt;br /&gt;



&lt;/div&gt;

   &lt;asp:UpdateProgress id="UpdateProgress1" AssociatedUpdatePanelID="UpdatePanel1" runat="server" DisplayAfter="0"&gt;

&lt;progresstemplate&gt;



&lt;div id="Layer1"&gt;

&lt;asp:Image id="Image1" runat="server" __designer:wfdid="w2" ImageUrl="~/images/ajax-loader2.gif"&gt;&lt;/asp:Image&gt; &lt;asp:Label id="lblProcess" runat="server" CssClass="css_ProcessLabel" __designer:wfdid="w3"&gt;Processing....&lt;/asp:Label&gt; 

&lt;/div&gt;

&lt;/progresstemplate&gt;

    &lt;/asp:UpdateProgress&gt;

    &lt;br /&gt;

&lt;/asp:Content&gt;
</code></pre>

<p>Thanks in advance</p>
