Can we change text of Browse Button in FileUpload Control to Other language? Am working on Localization. Am not able to change name cause When i generate Local Resource file for FileUPload component only this comes (FileUpload1Resource1.ToolTip). I want
to change Button Text. How can i change?
<div mce_keep="true">make a button (for instance an input; it doesn't even have to run at server)</div>
<div mce_keep="true">when the button is clicked, perform some javascript</div>
<div mce_keep="true">the javascript will get the fileInput, and perform the click on it.</div>
<div mce_keep="true">the 'Open File'-dialog is opened by pressing on a button you can modify any way you want.</div>
<div mce_keep="true">Hide the fileInput control</div>
Hope this helps!
Wim
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
1) Have you set the Language UI thread of the site?
2) Have you set tried setting your OS to a different language?
I ask becuase if your using the asp.net control then I beleive it will use the default settings for the language of the control, but I'm not sure if it takes the language from the thread or the OS so worth setting Windows to another Language to see what
language the button appears as.
As far as I know, we cannot localize the file upload dialog box. It is a client call and its language depends on the language of the OS on the client side.
If you just wish to change the language on the click button, you can use deblendewim's suggestion, to make a file upload control yourself. The only way to change the file open dialog box is to construct an ActiveX control of your own to do this.
If this does not answer your question, please feel free to mark the post as Not Answered and reply. Thank you!
Sincerely,
Kevin Yu
Microsoft Online Community Support
Please remember to click “Mark as Answer” on the post that helps you, and to click “Mark as Not Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
Marked as answer by Kevin Yu - MSFT on Jun 19, 2007 09:15 AM
Here is a complete example. Both buttons trigger the hidden input (type="file") element. One button is a html button (pure clientside), the other button is the asp:button.
If you have any other questions/remarks, please let me know.
Good luck!
Wim
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
This is working fine!, but, I realize that if I put "runat="server"" to the File1 object, the "File Browser" window is not raised. I need to get the posted file in the "CodeBehind"... How do I do this?
I think that the value of the input control (type=file) is not remembered during postback.
One thing is weird: If I put runat="server" on my File1 control, it still gets triggered and the Open File Dialog still pop's up? (But, it doesn't have to be runat="server" since the value isn't remembered during postback)
You can solve this by doing the following ....
<div mce_keep="true">in the input control (type=file) you have an event onchange. </div>
<div mce_keep="true">This event gets triggered whenever the value of the control changes</div>
<div mce_keep="true">When that occurs, call a javascript function to get the value of the input-control (type=file) </div>
<div mce_keep="true">Store that value in an input-control (type=hidden) </div>
<div mce_keep="true">make sure the input control (type=hidden) is runat="server".</div>
<div mce_keep="true">then in code-behind, get the value out of the hidden input control. (This value is remembered during postback!)</div>
Partial Class _Default
Inherits System.Web.UI.Page
Protected Sub Button3_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim inputValue As String
inputValue = Me.Hidden1.Value
End Sub
End Class
Hope this helps!
Wim
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
I have to fix some issues because I'm working with master page, so, I have ContentPlaceHolder that changes the client's name controls and also I'm using an UpdatePanel (UpdatePanels do not supports FileUploads)....
barrysuku
Member
12 Points
82 Posts
How to change Text in FileUpload control
Jun 14, 2007 03:07 AM|LINK
Can we change text of Browse Button in FileUpload Control to Other language? Am working on Localization. Am not able to change name cause When i generate Local Resource file for FileUPload component only this comes (FileUpload1Resource1.ToolTip). I want to change Button Text. How can i change?
FileUpload MultiLanguage Localization
deblendewim
Contributor
5590 Points
951 Posts
Re: How to change Text in FileUpload control
Jun 14, 2007 11:38 AM|LINK
I'm not sure you can change it.
I did it this way:
Hope this helps!
Wim
mp_mdavies
Member
19 Points
12 Posts
Re: How to change Text in FileUpload control
Jun 14, 2007 02:14 PM|LINK
Hi there, two questions:
1) Have you set the Language UI thread of the site?
2) Have you set tried setting your OS to a different language?
I ask becuase if your using the asp.net control then I beleive it will use the default settings for the language of the control, but I'm not sure if it takes the language from the thread or the OS so worth setting Windows to another Language to see what language the button appears as.
Michael
Kevin Yu - M...
All-Star
19021 Points
1467 Posts
Re: How to change Text in FileUpload control
Jun 19, 2007 09:14 AM|LINK
Hi,
As far as I know, we cannot localize the file upload dialog box. It is a client call and its language depends on the language of the OS on the client side.
If you just wish to change the language on the click button, you can use deblendewim's suggestion, to make a file upload control yourself. The only way to change the file open dialog box is to construct an ActiveX control of your own to do this.
If this does not answer your question, please feel free to mark the post as Not Answered and reply. Thank you!
Kevin Yu
Microsoft Online Community Support
Please remember to click “Mark as Answer” on the post that helps you, and to click “Mark as Not Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
rdelgadoj
Member
9 Points
5 Posts
Re: How to change Text in FileUpload control
Aug 01, 2007 06:15 PM|LINK
Hi,
I'm trying to do what you said... but my javascript is not working Could you show me you javascript (step 3) pls?
Thanks in advance
deblendewim
Contributor
5590 Points
951 Posts
Re: How to change Text in FileUpload control
Aug 02, 2007 07:40 AM|LINK
Hi rdelgadoj,
Here is a complete example. Both buttons trigger the hidden input (type="file") element. One button is a html button (pure clientside), the other button is the asp:button.
<html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>Untitled Page</title> <script type="text/javascript"> function triggerFileUpload() { document.getElementById("File1").click(); } </script> </head> <body> <form id="form1" runat="server"> <div> <input id="File1" type="file" style=" visibility:hidden;" /> <br /> <br /> <asp:Button ID="Button1" OnClientClick="triggerFileUpload()" runat="server" Text="ASPNET Button" /> <br /> <br /> <input id="Button2" type="button" onclick="triggerFileUpload()" value="HTML Button" /> <br /> <br /> </div> </form> </body> </html>If you have any other questions/remarks, please let me know.
Good luck!
Wim
rdelgadoj
Member
9 Points
5 Posts
Re: How to change Text in FileUpload control
Aug 03, 2007 02:57 PM|LINK
Hi Wim,
Thanks very much.
This is working fine!, but, I realize that if I put "runat="server"" to the File1 object, the "File Browser" window is not raised. I need to get the posted file in the "CodeBehind"... How do I do this?
Thanks!
deblendewim
Contributor
5590 Points
951 Posts
Re: How to change Text in FileUpload control
Aug 09, 2007 09:30 AM|LINK
Hi rdelgadoj,
Sorry for my late reply ....
I think that the value of the input control (type=file) is not remembered during postback.
One thing is weird: If I put runat="server" on my File1 control, it still gets triggered and the Open File Dialog still pop's up? (But, it doesn't have to be runat="server" since the value isn't remembered during postback)
You can solve this by doing the following ....
Here is an example:
html:
<html xmlns="http://www.w3.org/1999/xhtml" > <head id="Head1" runat="server"> <title>Untitled Page</title> <script type="text/javascript"> function triggerFileUpload() { document.getElementById("File1").click(); } function setHiddenValue() { document.getElementById("Hidden1").value = document.getElementById("File1").value; } </script> </head> <body> <form id="form1" runat="server"> <div> <input runat="server" id="Hidden1" type="hidden" /> <input runat="server" id="File1" type="file" onchange="setHiddenValue()" style=" visibility:hidden;" /> <br /> <br /> <asp:Button ID="Button1" OnClientClick="triggerFileUpload()" runat="server" Text="ASPNET Button" /> <br /> <br /> <input id="Button2" type="button" onclick="triggerFileUpload()" value="HTML Button" /> <br /> <br /> <asp:Button ID="Button3" runat="server" Text="Go CodeBehind To Get Input Value" /> </div> </form> </body> </html>code-behind:
Hope this helps!
Wim
rdelgadoj
Member
9 Points
5 Posts
Re: How to change Text in FileUpload control
Aug 09, 2007 04:40 PM|LINK
Win,
Thanks a lot! This solved my problem.
I have to fix some issues because I'm working with master page, so, I have ContentPlaceHolder that changes the client's name controls and also I'm using an UpdatePanel (UpdatePanels do not supports FileUploads)....
This is great!
Again Thanks a lot!
ahmed_fci200...
Member
12 Points
12 Posts
Re: How to change Text in FileUpload control
Sep 19, 2007 09:23 AM|LINK
[:(]i want your help plzzzzzzzzzzzzzzz.
this code is run in html page and I'm using aspx page with masterpage so can you help me to get the same code that can work in my project plz.
thx
ASP.net 2.0