Solved

Hourglass before DB processing in ASP.NET

Posted on 2002-07-15
6
284 Views
Last Modified: 2010-04-14
Hello,

I have client side scripting on my aspx page. When a user clicks on a link, I do an XML/XSL transform which gets data from the database and render the page again. I'm trying to change the mouse pointer to an hourglass so the user knows that some processing is taking place. Also, I want to reset the mouse pointer back to default when it's done processing. I've tried inserting (document.body.style.cursor = "wait";) before the process and resetting it back to (document.body.style.cursor = "default";) after the processing is done. This doesn't seem to work. I tried the same method with an alert box and it does what I want it to do, because the alert will cause event processing. Does anyone know how to do this. What I need to find is a way to make the browser process windows events before database processing begins. Please respond if you have a solution for this.

Thanks
0
Comment
Question by:tinman1412
  • 3
  • 2
6 Comments
 
LVL 22

Expert Comment

by:CJ_S
ID: 7154620
You can set the BODY, but you need to set it for ALL items. Note that it will only work in IE.

  for(i in document.all)
  {
       if(document.all[i].style)
       {
            document.all[i].lastStyle = document.all[i].style
            document.all[i].style.cursor = "wait";
       }
  }

And do the following when done:

  for(i in document.all)
  {
       if(document.all[i].style)
       {
            document.all[i].style = document.all[i].lastStyle;
        }
  }
0
 

Author Comment

by:tinman1412
ID: 7154722
I get an error when resetting the cursor. The error says that "htmlfile: Member not found".  I don't think "lastStyle" is a memeber.  Please verifiy and provide the right property

Thanks
0
 
LVL 22

Accepted Solution

by:
CJ_S earned 50 total points
ID: 7155065
for(i in document.all)
 {
      if(document.all[i].style)
      {
           document.all[i].lastStyle = document.all[i].style.cursor;
           document.all[i].style.cursor = "wait";
      }
 }

and

 for(i in document.all)
 {
      if(document.all[i].style)
      {
           document.all[i].style.cursor = document.all[i].lastStyle;
      }
 }
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 

Author Comment

by:tinman1412
ID: 7155417
CJ_S ,

I'm not sure why, but this doesn't seem to work.
In my xsl, I have it where I'm setting the cursor to a hand when a user hovers over the link.  With the above code, nothing happens like how I want it, but the hand cursor is no longer there.  Any suggestions. I'm thinking that the browser is not processing the interface events, and I'm not sure why.

Thanks
0
 
LVL 22

Expert Comment

by:CJ_S
ID: 7156639
I don't understand what you mean. I checked the code in a plain HTML file and it works just fine. No idea about XSL. Cqan you give me an output example?

CJ
0
 

Expert Comment

by:Tegron1
ID: 14078949
document.body.style.cursor="wait";
document.body.style.cursor="auto";


this works too.
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IP addresses can be stored in a database in any of several ways.  These ways may vary based on the volume of the data.  I was dealing with quite a large amount of data for user authentication purpose, and needed a way to minimize the storage.   …
In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question