Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 26-01-2009
Member
 
Join Date: Dec 2008
Posts: 12
Change the default cursor to a Wait cursor in ASP.NET

Hi,

In my Asp.net application when a new page is loading i want that the default cursor should be change to wait cursor. I can do the same thing for the windows application but for web project i don't have any idea.

In Windows-Based Applications I'm using:
Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;

How can I use something similar in ASP?

Thanks.
Reply With Quote
  #2  
Old 26-01-2009
Member
 
Join Date: Apr 2008
Posts: 1,948
Re: Change the default cursor to a Wait cursor in ASP.NET

With ASP.NET pages this is a bit more of a problem to do. You need to employ a little JavaScript.

Add this JavaScript between the <HEAD> tags on your ASP.NET web page:

Code:
   function setHourglass()
  {
    document.body.style.cursor = 'wait';
  }
Now you have to tell the web form to run the JavaScript funciton when a post back happens.

Add this to your <BODY> tag:

Code:
  <body onbeforeunload="setHourglass();" onunload="setHourglass();">
Reply With Quote
  #3  
Old 26-01-2009
Member
 
Join Date: May 2008
Posts: 2,008
Re: Change the default cursor to a Wait cursor in ASP.NET

Hi

onload event fires when the page has completely rendered

you will have to do the following

set the cursor to wait on any postback events u do like button click

Code:
<asp:Button ID="Button1" runat="server" Text="Button"  OnClientClick = "document.all[1].style.cursor = wait"/>
and on body load u will have to set it to default

Code:
<body onload="document.all[1].style.cursor = 'default'" >
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Change the default cursor to a Wait cursor in ASP.NET"
Thread Thread Starter Forum Replies Last Post
Mouse cursor won't change in Google Chrome when hover over link The#Gaelic Technology & Internet 4 03-03-2012 10:55 AM
Mouse cursor do not change to selected theme on Helena SURNAME Operating Systems 4 05-07-2011 06:23 AM
Cursor Location GameTechGirl Software Development 1 20-02-2011 12:56 AM
How to change Windows 7 cursor to game cursor Calebh Operating Systems 5 18-01-2010 04:54 PM
Change the appearance of cursor in the browser CAILYN Software Development 5 09-01-2010 06:35 AM


All times are GMT +5.5. The time now is 06:48 AM.