gpt4 book ai didi

asp.net - 更改 AjaxFileUpload 控件的语言

转载 作者:行者123 更新时间:2023-12-02 10:02:33 24 4
gpt4 key购买 nike

我想在我的 C# 网站中使用 AjaxFileUpload 控件。我希望我的控件能够使用我的本地语言。我尝试了下面的代码。在我的代码中,有些单词不是彩色的(例如:Sys.Extended.UI.Resources.AjaxFileUpload_SelectFile = "Dosya Seç";)它就像未定义。如何更改控件的语言?

<style type="text/css">

/* Buttons widths */
.ajax__fileupload_fileItemInfo div.removeButton{width:100px;}
div.ajax__fileupload_uploadbutton{width:120px;}
.ajax__fileupload .ajax__fileupload_selectFileContainer{width: 110px;}
.ajax__fileupload_selectFileContainer .ajax__fileupload_selectFileButton{width: 110px;}
</style>

 $(document).ready(function () {
AjaxFileUpload_change_text();

});



function AjaxFileUpload_change_text() {

Sys.Extended.UI.Resources.AjaxFileUpload_SelectFile = "Dosya Seç";
Sys.Extended.UI.Resources.AjaxFileUpload_DropFiles = "Sürükle-Bırak";
Sys.Extended.UI.Resources.AjaxFileUpload_Pending = "Bekliyor";
Sys.Extended.UI.Resources.AjaxFileUpload_Remove = "Kaldır";
Sys.Extended.UI.Resources.AjaxFileUpload_Upload = "Yükle";
Sys.Extended.UI.Resources.AjaxFileUpload_Uploaded = "Uploaded";
Sys.Extended.UI.Resources.AjaxFileUpload_UploadedPercentage = "uploaded {0} %";
Sys.Extended.UI.Resources.AjaxFileUpload_Uploading = "Uploading";
Sys.Extended.UI.Resources.AjaxFileUpload_FileInQueue = "{0} file(s) in queue.";
Sys.Extended.UI.Resources.AjaxFileUpload_AllFilesUploaded = "All Files Uploaded.";
Sys.Extended.UI.Resources.AjaxFileUpload_FileList = "List of Uploaded files:";
Sys.Extended.UI.Resources.AjaxFileUpload_SelectFileToUpload = "Please select file(s) to upload.";
Sys.Extended.UI.Resources.AjaxFileUpload_Cancelling = "Cancelling...";
Sys.Extended.UI.Resources.AjaxFileUpload_UploadError = "An Error occured during file upload.";
Sys.Extended.UI.Resources.AjaxFileUpload_CancellingUpload = "Cancelling upload...";
Sys.Extended.UI.Resources.AjaxFileUpload_UploadingInputFile = "Uploading file: {0}.";
Sys.Extended.UI.Resources.AjaxFileUpload_Cancel = "Cancel";
Sys.Extended.UI.Resources.AjaxFileUpload_Canceled = "cancelled";
Sys.Extended.UI.Resources.AjaxFileUpload_UploadCanceled = "File upload cancelled";
Sys.Extended.UI.Resources.AjaxFileUpload_DefaultError = "File upload error";
Sys.Extended.UI.Resources.AjaxFileUpload_UploadingHtml5File = "Uploading file: {0} of size {1} bytes.";
Sys.Extended.UI.Resources.AjaxFileUpload_error = "error";
}

最佳答案

您可以使用 JavaScript 或 jQuery 来更改该文本:

只需将此代码添加到您正在使用文件上传控件的页面顶部即可。

 <script>
function pageLoad(sender, args) {

//By jQuery
$(".ajax__fileupload_selectFileButton").text("Dosya Seç");

//By JavaScript
document.getElementsByClassName('ajax__fileupload_selectFileButton')[0].innerHTML = "Dosya Seç";
}
</script>

并使用相同的技术来更改其他文本。

关于asp.net - 更改 AjaxFileUpload 控件的语言,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24687983/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com