Results 1 to 3 of 3

Thread: Change the default cursor to a Wait cursor in ASP.NET

  1. #1
    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.

  2. #2
    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();">

  3. #3
    Join Date
    May 2008
    Posts
    2,012

    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'" >

Similar Threads

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

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,427,633.81434 seconds with 17 queries