Solved

Hourglass before DB processing in ASP.NET

Posted on 2002-07-15
6
308 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
How our DevOps Teams Maximize Uptime

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

 

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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

707 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