asp.net中的FileUpload控件 [英] FileUpload control in asp.net

查看:80
本文介绍了asp.net中的FileUpload控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在asp.net应用程序中使用asp fileUpload控件。它在VS2012的右侧显示一个带有按钮的文本字段,该按钮具有文本浏览,一切看起来都很完美,但是按钮上的文本在运行时更改为选择文件,按钮跳转到文本字段,如何将文本更改回浏览并保留文本字段右侧的按钮?



感谢您的帮助。

解决方案

这些标签在浏览器中是硬编码的。以下链接是一篇有趣的文章(包括解决方案):

http:// www。 quirksmode.org/dom/inputfile.html [ ^ ]



祝你好运!


FileUpload控件呈现为类型相等的HTML输入标签。

这个单个标签呈现为一对文本框和按钮,但没有属性来设置按钮上的文本...

不同的浏览器分配不同的文本,IE将其设置为浏览,Chrome设置为选择文件...

使用标准HTML / CSS技术更改文本是不可能的,你必须引入一个虚假的可见元素,隐藏输入...

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.

解决方案

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!


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...


这篇关于asp.net中的FileUpload控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆