Connecting Tech Pros Worldwide Forums | Help | Site Map

"Loading message" while loading ASP.NET pages

Member
 
Join Date: Aug 2008
Posts: 40
#1: Nov 12 '08
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's Avatar
Expert
 
Join Date: Jan 2008
Location: Bath, UK
Posts: 1,609
#2: Nov 12 '08

re: "Loading message" while loading ASP.NET pages


HTML:
Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3. <!-- include CSS and JavaScript -->
  4. </head>
  5. <body>
  6. <div id="wrapper">
  7. <!--  whole content goes here  -->
  8. </div>
  9. </body>
  10. </html>
javascript:
Expand|Select|Wrap|Line Numbers
  1. window.onload = function () {
  2.     document.getElementById('wrapper').style.display = 'block';
  3.     document.body.backgroundImage = 'none';
  4. }
CSS:
Expand|Select|Wrap|Line Numbers
  1. body {background: white url('loading.gif') no-repeat center center; }
  2. #wrapper {display: none;}
Member
 
Join Date: Aug 2008
Posts: 40
#3: Nov 13 '08

re: "Loading message" while loading ASP.NET pages


Quote:

Originally Posted by hsriat

HTML:

Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3. <!-- include CSS and JavaScript -->
  4. </head>
  5. <body>
  6. <div id="wrapper">
  7. <!--  whole content goes here  -->
  8. </div>
  9. </body>
  10. </html>
javascript:
Expand|Select|Wrap|Line Numbers
  1. window.onload = function () {
  2.     document.getElementById('wrapper').style.display = 'block';
  3.     document.body.backgroundImage = 'none';
  4. }
CSS:
Expand|Select|Wrap|Line Numbers
  1. body {background: white url('loading.gif') no-repeat center center; }
  2. #wrapper {display: none;}





Thanks but the image is getting displayed even after the page load.What should i do for it??
hsriat's Avatar
Expert
 
Join Date: Jan 2008
Location: Bath, UK
Posts: 1,609
#4: Nov 14 '08

re: "Loading message" while loading ASP.NET pages


Sorry, just a little mistake...
Expand|Select|Wrap|Line Numbers
  1. document.body.style.backgroundImage = 'none';
  2.  
Newbie
 
Join Date: Feb 2009
Posts: 1
#5: Feb 26 '09

re: "Loading message" while loading ASP.NET pages


Can u please send me the entire code.. I am unable to understand the code.
Pls send the aspx page
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,589
#6: Feb 26 '09

re: "Loading message" while loading ASP.NET pages


If you want help adding JavaScript to an ASP.NET page, you'd probably better off asking in the ASP.NET forum.
Newbie
 
Join Date: Sep 2009
Location: Raipur,India
Posts: 7
#7: Sep 14 '09

re: "Loading message" while loading ASP.NET 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..
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,589
#8: Sep 14 '09

re: "Loading message" while loading ASP.NET pages


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
Reply