Solved

Hourglass before DB processing in ASP.NET

Posted on 2002-07-15
6
276 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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

929 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now