0

I have a situation where it's been required that the Browse/SelectFile/etc button be styled to match our conventional styles that are everywhere else.

Previously I tried to just hide the default control and expose my own Browse and Save buttons, but I've found that doing style="visibility:hidden;width:0px" in a FileUpload control style breaks the control for IE.

So how can I style the stock asp:FileUpload button(s)?

Thanks.

kmarks2
  • 4,755
  • 10
  • 48
  • 77

1 Answers1

1

What if you tried style="display:none;" instead?

Paritosh
  • 4,243
  • 7
  • 47
  • 80
  • Same effect as what I have. Works fine in Chrome/FF, but IE does not like it. – kmarks2 Apr 24 '13 at 19:14
  • Which version of IE are you using? Otherwise, if you can use Jquery, it has a .hide() method, which should work similar to display:none, but might work better in IE. http://api.jquery.com/hide/ – Paritosh Apr 24 '13 at 19:28
  • IE 9.0.8. Was this not an issue in earlier version of IE? – kmarks2 Apr 24 '13 at 19:31
  • not that i know of, but i've never tried to hide a file upload, other controls i've always been able to hide with display:none; in all browsers. – Paritosh Apr 24 '13 at 19:39
  • 1
    after looking around, it seems like you can't style is easily for security reasons. http://stackoverflow.com/questions/6376452/hide-the-browse-button-on-a-input-type-file see last message. there is also a way to get around it in the same link, the one marked answer – Paritosh Apr 24 '13 at 19:42