Solved

Hourglass before DB processing in ASP.NET

Posted on 2002-07-15
6
291 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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Summary Displaying images in RichTextBox is a common requirement with limited solutions available. Pasting through clipboard or embedding into RTF content only support static images.  This article describes how to insert Windows control objects int…
Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

809 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