Click here to Skip to main content
15,885,366 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
JavaScript
function loading(){
            document.getElementById("load").style.display = 'block';
        }

HTML
<div id="load" style="display:none;background-color:rgba(0, 0, 0, 0.2);">
        <div id="loadmain">
        <img style="margin-top:10px;" src="Images/loading.gif" alt="loading" />
        <br />
        <h1 style="color:black;">Please Wait...</h1>
        </div>       
    </div>

Loading div is in master page.
Assume i have three pages:-
First page having search button
ASP.NET
<asp:Button ID="but_adidsearch" runat="server" OnClientClick="return termvalidate()" 
                    Text="" onclick="but_adidsearch_Click" />

i click on search button and loading div show and then results are show in the second page.
and when i go to third page and click browser back button then the loading div is occur again and stay in the page till i refresh the page url.
Why it is again showing.
Posted
Updated 9-Apr-22 7:30am

$(window).bind("pageshow", function(event) {
$('#load').hide();
});
 
Share this answer
 
If it's on the masterpage, then you will have to update the div's status everytime you want it to be changed.

I think this jQuery code can help you here:

JavaScript
$(document).ready(function(){
     $("#load").hide();
});


put it on your masterpage.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900