문제

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