Click here to Skip to main content
15,113,692 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I use a asp fileUpload control in an asp.net app. It shows a text field with a button on the right in VS2012, the button has text 'Browse', everything looks perfect, but the text on the button is changed to 'Choose file' in the run time and the button jumped into text field, how can I change the text back to 'Browse' and keep the button on the right of text field?

Thanks for your help.
Posted
Comments
ZurdoDev 14-Jan-15 11:10am
   
Sounds like you have some styling issues going on. Or perhaps it's a bug in the control with newer versions of browser.

Those labels are hard coded in the browser. Following link is an interesting article about it (including a solution):
http://www.quirksmode.org/dom/inputfile.html[^]

Good luck!
   
v2
FileUpload control renders as HTML input tag with type equal file.
This single tag renders as a pair of text-box and button, but has no attribute to set the text on the button...
Different browsers assign different text, IE sets it to Browse, where Chrome sets to Choose file...
Change the text is impossible using standard HTML/CSS techniques and you have to introduce a fake visible element with the input hidden to do so...
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900