Tuesday, May 31, 2022

Update Panel ASP.NET C# loading.gif masking css



 If we have master page in asp.net, use below code:-

 <style type="text/css">

 .divWaiting {

position: absolute;

background-color: #FAFAFA;

z-index: 2147483647 !important;

opacity: 0.8;

overflow: hidden;

text-align: center;

top: 0;

left: 0;

height: 100%;

width: 100%;

padding-top:20%;

}

</style>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">

    <asp:ScriptManager ID="ScriptManager1" EnablePageMethods="true" runat="server">

    </asp:ScriptManager>

<asp:UpdatePanel ID="UpdGrid" runat="server" UpdateMode="Always">

            <ContentTemplate>

                <asp:UpdateProgress ID="updprogress" runat="server" DisplayAfter="0"  AssociatedUpdatePanelID="UpdGrid">

       <ProgressTemplate>

        <div class="divWaiting">

            <asp:Label ID="lblWait" runat="server" 

Text=" Please wait... " />

            <asp:Image ID="imgWait" runat="server" ImageUrl="~/loading.gif"    />

          </div>

       </ProgressTemplate>

       </asp:UpdateProgress>

 </ContentTemplate>

        </asp:UpdatePanel>

</asp:Content>


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

Note:- If this is not working properly than Change  .divWaiting {

position: absolute; } to position: fixed; 

No comments:

Post a Comment