Solved

Hourglass before DB processing in ASP.NET

Posted on 2002-07-15
6
267 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
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Flash (http://en.wikipedia.org/wiki/Adobe_Flash) has evolved over the years to where it has become a masterful tool for displaying content screen.  It has excellent layout placement, UI precision as well as rendering capabilities. This, along with t…
Normally the drop down box control found in the .Net framework tools is able to select just one data and value at a time, which is displayed on the text area.   But what if you want to have multiple values to be selected in the drop down box? As …
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

757 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

19 Experts available now in Live!

Get 1:1 Help Now