Click here to Skip to main content
14,427,928 members
Rate this:
Please Sign up or sign in to vote.
Hi guys,

I have ASP.NET(C#) web application, in which i have some pages and in each page
i want to place a loading img, without using updateprogress.

Using javascript/jquery can i do this?

What I have tried:

i have tried using updateprogress but it is making problem when i have repeater in that page, and have some buttons in that repeater, then these buttons are not able to get calling their events.

plz help me.

Thanks
Posted
Updated 16-May-16 23:53pm
Comments
F-ES Sitecore 16-May-16 5:55am
   
The html for the loading image will only be shown in the browser when the whole page has finished rendering as that is how asp.net works. So you'll need to completely re-design how your page works such that the only thing returned from a page request is the header\footer etc and the loading image, and you then load the content of your page via ajax and once it is done hide the loading image.

As we know nothing about your code, your page or how it is implemented we can't offer any specific advice.
Rate this:
Please Sign up or sign in to vote.

Solution 2

   
Rate this:
Please Sign up or sign in to vote.

Solution 3

There are couple of ways to do it, you can use HTML DIV which is used to display the loading progress image, using JQuery, see below snippet
[code]
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>

<script type="text/javascript">

    function ShowProgress() {

        setTimeout(function () {

            var modal = $('<div />');

            modal.addClass("modal");

            $('body').append(modal);

            var loading = $(".loading");

            loading.show();

            var top = Math.max($(window).height() / 2 - loading[0].offsetHeight / 2, 0);

            var left = Math.max($(window).width() / 2 - loading[0].offsetWidth / 2, 0);

            loading.css({ top: top, left: left });

        }, 200);

    }

    $('form').live("submit", function () {

        ShowProgress();

    });

</script>

[/code]
checkout below link for more details
Display loading progress image when Page Loads or does PostBack using ASP.Net[^]
Loading Message when Page Loads[^]
   

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




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100