Solved

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

Posted on 2004-08-25
3
278 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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

708 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

12 Experts available now in Live!

Get 1:1 Help Now