我只需要知道在没有选择文件时是否有办法更改Asp:FileUpload
显示的消息。
谢谢。
最佳答案
见上面的链接。我使用 css 隐藏默认文本并使用标签显示我想要的内容:
html
<div>
<input type='file' title="Choose a video please" id="aa" onchange="pressed()">
<label id="fileLabel">Choose file</label>
</div>
CSS
input[type=file]{
width:90px;
color:transparent;
}
JavaScript
window.pressed = function(){
var a = document.getElementById('aa');
if(a.value == "")
{
fileLabel.innerHTML = "Choose file";
}
else
{
var theSplit = a.value.split('\\');
fileLabel.innerHTML = theSplit[theSplit.length-1];
}
};
关于c# - ASP :FileUpload edit "No file selected" message,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20201424/