tags:

views:

645

answers:

5

How can I remove the dotted border around an asp: Image button. The dotted border shows when I click on the image button. Thanks

+1  A: 

It looks like you are talking about the focusing border added by the browser. There's a trick to do this with Javascript. Add the following to your image tag:

onfocus="this.blur();"
x-way
+3  A: 

That's the focusing border added by the browser. For usability purposes, it's usually a bad idea to remove it unless you are doing something specific. It's very difficult to select controls using the keyboard without it.

If for some reason you REALLY need to remove it, I believe the other answers here may provide you with a solution. But as someone often concerned with usability, I would advise you to reconsider.

Matt Olenik
+1  A: 

Adding the following attribute/value to the imagebutton should produce the result you are looking for.

OnClientClick="this.blur();"
Quintin Robinson
+1 I prefer this way as opposed to the onfocus version. This will allow the usability on the keyboard, and only remove the dotted border when the user clicks.
Chris
A: 

sound. onfocus="this.blur();" does the trick.

A: 

Try this CSS:

input:focus{outline:none;}

larry