I encounter problem when changing culture (language) on my website. In fact all the controls correctly change language. But only controls "asp: FileUpload" do not change. The text description is always the same ... Is it possible to force the language on the buttons like "" or "?

Thank you already in advance.

有帮助吗?

解决方案

You can hide the button thru CSS styling selecting its ID.

<style type="text/css">
    input.fileUpload{
        display: block;
        visibility: hidden;
        width: 0;
        height: 0;
    }
</style>

Then create a button that would trigger the file upload.

<script type="text/javascript">
$("#alternateUploadButton").click(function(){
    $("#fileUpload").click();
});
</script>
<input type="file" id="fileUpload" name="fileUpload">
<button id="alternateUploadButton">
    Get a file or whatever name you want
</button>

http://jsfiddle.net/SPVkq/

其他提示

Unfortunately the "Browse..." label on the file upload button is provided by the browser, not by your markup, and so it out of your control. There are some hacks, but you may want to consider if it's worth the trouble, as this "Browse..." button should be in a language that the user understands since it matches their browser's language.

See this other post for more info: ASP.NET FileUpload - How to change the language of the "Browse..." button description?

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top