UpdatePanel Query

WebDevGuy 1 Reputation point
2021-08-13T10:52:39.01+00:00

I'm trying to create a webforms page (inside a master) that immediately displays 'loading...' text while the page content is built.

I can do this quite easily if I have a button that is first clicked to call the build method but if I call the build method in the PAGE_LOAD the page doesn't render at all until the page is built.

How would I do this?

ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,291 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Laxmikant 216 Reputation points
    2021-08-31T05:07:37.083+00:00

    you can do it using jQuery

    add a div in webpage or master page with id

    <div id="iconloading"></div>
    

    use css for it, change the path of gif as per your requirement

    #iconloading {
    position: fixed;
    width: 100%;
    height: 100vh;
    background: #fff url('images/loader.gif') no-repeat center center;
    z-index: 9999;
    }
    

    add below jQuery code in your script

    <script>
    jQuery(document).ready(function() {
    jQuery('#iconloading').fadeOut(3000);
    });
    </script>

    0 comments No comments