You must Sign In to post a response.
  • Category: ASP.NET

    Hide the progress bar in background

    <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();
    });

    function ShowProgress() {
    var prm = Sys.WebForms.PageRequestManager.getInstance();
    prm.add_endRequest(hideMethod);
    }

    function hideMethod() {
    $('#loading').hide();
    }

    When click the export button popup will open in that popup open and save button is there.

    When i click the open button progress bar will appear and then excel file will open

    And close that excel file in background that progress bar is showing

    For hiding the progress bar in background i written code as follows

    function ShowProgress() {
    var prm = Sys.WebForms.PageRequestManager.getInstance();
    prm.add_endRequest(hideMethod);
    }

    function hideMethod() {
    $('#loading').hide();
    }

    When i write the above code then when i execute and run at the time of click the open button in popup, that progress bar is not showing
    for that how can i do.

    i want after closing that excel in background the progress bar will not be shown
    at the time of click the open button in popup progress bar will be displayed
  • #765839
    Hi,

    As I seen your code you want to hide the Div tag, you can do it in several ways like in client side and server side, i will share you how to hide it in client side.


    <div class="loading" align="center">
    Loading. Please wait.<br />
    <br />
    <img src="loader.gif" alt="" />
    </div>


    this is your loading part design, in your div you are using class, if you want to hide based on class then use below code


    $( ".loading" ).hide();


    but the problem with hiding using class name is whenever you use the same class name all the div tags are hided, so to over come the above problem you have to declare the id of the div with name "divloading" and hide the div using that id.


    $( "#divloading" ).hide();


    Use the above code wherever you want...
    Hope this will helpful to you...

    --------------------------------------------------------------------------------
    Give respect to your work, Instead of trying to impress your boss.

    N@veen
    Blog : http://naveens-dotnet.blogspot.in/


Sign In to post your comments