Solved

How to NOT display "little hand" of mouse when image button is disabled?

Posted on 2004-08-25
3
281 Views
Last Modified: 2011-10-03
I wouldn't want to display the "little hand" of the mouse when my image button is disabled. Does any one know how to do that?

MyImageButton.Enabled = False

Then how to not display the little hand of the mouse?
Thanks!
0
Comment
Question by:CrazyNet
  • 2
3 Comments
 
LVL 3

Expert Comment

by:alexpreston
ID: 11900227
Try   MyImageButton.style = "cursor: default"
0
 
LVL 3

Expert Comment

by:alexpreston
ID: 11900240
ooh, .NET.

Try this instead   MyImageButton.Attributes.Add("style", "cursor:default")
0
 
LVL 8

Accepted Solution

by:
shovavnik earned 150 total points
ID: 11900536
Don't use the second one, as you'll overwrite the existing style information.

Instead use the special style property:

MyImageButton.Style.Add("cursor", "default")

But the best way is to not do this in the codebehind.  Rather, it's much better to manage style informationon the client.  
Use one of the following methods:
1. Add it to the style attribute of the control.
2. Add a css class for images either in a linked css file or in a <styles> element on your page:
img {
  cursor: default;
}

The reason to do this on the client side, is that it makes it much easier to maintain.  You want to avoid needing to recompile your code just to change style information.  CodeBehind isn't good for *everything*.
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

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