"Loading message" while loading ASP.NET pages

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • divyac
    New Member
    • Aug 2008
    • 40

    "Loading message" while loading ASP.NET pages

    I want to show a Progress bar image while loading ASP.NET pages in the browser. I am using ASP.NET 2.0/C#.I want to do it in javascript and not with ajax.help me pls........
  • hsriat
    Recognized Expert Top Contributor
    • Jan 2008
    • 1653

    #2
    HTML:
    Code:
    <html>
    <head>
    <!-- include CSS and JavaScript -->
    </head>
    <body>
    <div id="wrapper">
    <!--  whole content goes here  -->
    </div>
    </body>
    </html>
    JavaScript:[code=javascript]
    window.onload = function () {
    document.getEle mentById('wrapp er').style.disp lay = 'block';
    document.body.b ackgroundImage = 'none';
    }[/code]
    CSS:[code=css]body {background: white url('loading.gi f') no-repeat center center; }
    #wrapper {display: none;}[/code]

    Comment

    • divyac
      New Member
      • Aug 2008
      • 40

      #3
      Originally posted by hsriat
      HTML:
      Code:
      <html>
      <head>
      <!-- include CSS and JavaScript -->
      </head>
      <body>
      <div id="wrapper">
      <!--  whole content goes here  -->
      </div>
      </body>
      </html>
      JavaScript:[code=javascript]
      window.onload = function () {
      document.getEle mentById('wrapp er').style.disp lay = 'block';
      document.body.b ackgroundImage = 'none';
      }[/code]
      CSS:[code=css]body {background: white url('loading.gi f') no-repeat center center; }
      #wrapper {display: none;}[/code]




      Thanks but the image is getting displayed even after the page load.What should i do for it??

      Comment

      • hsriat
        Recognized Expert Top Contributor
        • Jan 2008
        • 1653

        #4
        Sorry, just a little mistake...
        Code:
        document.body.style.backgroundImage = 'none';

        Comment

        • pramodbura
          New Member
          • Feb 2009
          • 1

          #5
          Can u please send me the entire code.. I am unable to understand the code.
          Pls send the aspx page

          Comment

          • acoder
            Recognized Expert MVP
            • Nov 2006
            • 16032

            #6
            If you want help adding JavaScript to an ASP.NET page, you'd probably better off asking in the ASP.NET forum.

            Comment

            • saurabhsingh
              New Member
              • Sep 2009
              • 7

              #7
              Problem with master pages

              Can anyone plz suggest any Idea that How to implement "loading message" in a site with master pages.
              I am having Default page which is master page enabled and it contains many Gridviews with database connection.
              This page is taking so much of time to load therefore I want to show loading message for this page only.

              Thanks in advance..

              Comment

              • acoder
                Recognized Expert MVP
                • Nov 2006
                • 16032

                #8
                If you have exactly the same JavaScript question, you may ask it here. If you have a similar question, ask in this forum, but if you have an ASP.NET question, ask in the ASP.NET forum. Thanks

                Comment

                Working...