ASP.Net show splash image during background compilation

Viewed 49

After compiling the entire asp.net project, when the first time the default.aspx page loads, asp.net compiles the pages into Temporary Asp.Net directory. This takes a long time during which I want to show a loading gif to the user.

Using a javascript on the default.aspx does not work as the page is practically not constructed yet. To get around this I created another page, say startup.html, that loads the splash and loads the default.aspx using windows.location.replace function.

This works but seems kludgy, Is there a better way of doing this?

<!DOCTYPE html>
<html>
<head>
    <style type="text/css">
        .load {
            width: 100%;
            height: 100%;
            position: fixed;
            z-index: 9999;
            background: url("images/loading.gif") no-repeat center center rgba(0,0,0,0.25);
        }
    </style>
    <script type="text/javascript" async>
        setTimeout(function () {
            window.location.replace("default.aspx");
        }, 100);
    </script>
</head>
<body>
    <div class="load" />
</body>
</html>
0 Answers
Related