none
AjaxFileUpload mudar o texto RRS feed

Respostas

  • Ta certo é isso ai:

    Se colocou na sua pagina o Jquery para que ele execute isso também

    ficaria mais ou menos assim sua tag head e também tem o gerenciador 

    ajaxToolkit:ToolkitScriptManager 
        <script src="Scripts/jquery-2.0.3.js"></script>
        <script type="text/javascript">
            $(document).ready(function () {
                AjaxFileUpload_change_text();
            });
            function AjaxFileUpload_change_text() {
                Sys.Extended.UI.Resources.AjaxFileUpload_SelectFile = "Selecione as imagens";
                Sys.Extended.UI.Resources.AjaxFileUpload_DropFiles = "Seleciona suas imagens";
                Sys.Extended.UI.Resources.AjaxFileUpload_Pending = "Pendente";
                Sys.Extended.UI.Resources.AjaxFileUpload_Remove = "Remover";
                Sys.Extended.UI.Resources.AjaxFileUpload_Upload = "Envia";
                Sys.Extended.UI.Resources.AjaxFileUpload_Uploaded = "Enviado";
                Sys.Extended.UI.Resources.AjaxFileUpload_UploadedPercentage = "Enviando {0} %";
                Sys.Extended.UI.Resources.AjaxFileUpload_Uploading = "Enviando ...";
                Sys.Extended.UI.Resources.AjaxFileUpload_FileInQueue = "{0} fotos(s) na fila.";
                Sys.Extended.UI.Resources.AjaxFileUpload_AllFilesUploaded = "Todos foram enviados com sucesso.";
                Sys.Extended.UI.Resources.AjaxFileUpload_FileList = "Lista de Fotos:";
                Sys.Extended.UI.Resources.AjaxFileUpload_SelectFileToUpload = "Fotos (s) para servidor.";
                Sys.Extended.UI.Resources.AjaxFileUpload_Cancelling = "Cancelling...";
                Sys.Extended.UI.Resources.AjaxFileUpload_UploadError = "Erros encontrados durante o upload";
                Sys.Extended.UI.Resources.AjaxFileUpload_CancellingUpload = "Cancelando";
                Sys.Extended.UI.Resources.AjaxFileUpload_UploadingInputFile = "Uploades Fotos: {0}.";
                Sys.Extended.UI.Resources.AjaxFileUpload_Cancel = "Cancelar";
                Sys.Extended.UI.Resources.AjaxFileUpload_Canceled = "Cancelada";
                Sys.Extended.UI.Resources.AjaxFileUpload_UploadCanceled = "Fotos upload cancelada";
                Sys.Extended.UI.Resources.AjaxFileUpload_DefaultError = "Fotos upload erros";
                Sys.Extended.UI.Resources.AjaxFileUpload_UploadingHtml5File = "Fotos: {0} de tamanho {1} em bytes.";
                Sys.Extended.UI.Resources.AjaxFileUpload_error = "Error";             
            }
        </script>

    Pagina em aspx total dela seria assim:

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm3.aspx.cs" Inherits="WebApplication1.WebForm3" %>
    
    <!DOCTYPE html>
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
        <script src="Scripts/jquery-2.0.3.js"></script>
        <script type="text/javascript">
            $(document).ready(function () {
                AjaxFileUpload_change_text();
            });
            function AjaxFileUpload_change_text() {
                Sys.Extended.UI.Resources.AjaxFileUpload_SelectFile = "Selecione as imagens";
                Sys.Extended.UI.Resources.AjaxFileUpload_DropFiles = "Seleciona suas imagens";
                Sys.Extended.UI.Resources.AjaxFileUpload_Pending = "Pendente";
                Sys.Extended.UI.Resources.AjaxFileUpload_Remove = "Remover";
                Sys.Extended.UI.Resources.AjaxFileUpload_Upload = "Envia";
                Sys.Extended.UI.Resources.AjaxFileUpload_Uploaded = "Enviado";
                Sys.Extended.UI.Resources.AjaxFileUpload_UploadedPercentage = "Enviando {0} %";
                Sys.Extended.UI.Resources.AjaxFileUpload_Uploading = "Enviando ...";
                Sys.Extended.UI.Resources.AjaxFileUpload_FileInQueue = "{0} fotos(s) na fila.";
                Sys.Extended.UI.Resources.AjaxFileUpload_AllFilesUploaded = "Todos foram enviados com sucesso.";
                Sys.Extended.UI.Resources.AjaxFileUpload_FileList = "Lista de Fotos:";
                Sys.Extended.UI.Resources.AjaxFileUpload_SelectFileToUpload = "Fotos (s) para servidor.";
                Sys.Extended.UI.Resources.AjaxFileUpload_Cancelling = "Cancelling...";
                Sys.Extended.UI.Resources.AjaxFileUpload_UploadError = "Erros encontrados durante o upload";
                Sys.Extended.UI.Resources.AjaxFileUpload_CancellingUpload = "Cancelando";
                Sys.Extended.UI.Resources.AjaxFileUpload_UploadingInputFile = "Uploades Fotos: {0}.";
                Sys.Extended.UI.Resources.AjaxFileUpload_Cancel = "Cancelar";
                Sys.Extended.UI.Resources.AjaxFileUpload_Canceled = "Cancelada";
                Sys.Extended.UI.Resources.AjaxFileUpload_UploadCanceled = "Fotos upload cancelada";
                Sys.Extended.UI.Resources.AjaxFileUpload_DefaultError = "Fotos upload erros";
                Sys.Extended.UI.Resources.AjaxFileUpload_UploadingHtml5File = "Fotos: {0} de tamanho {1} em bytes.";
                Sys.Extended.UI.Resources.AjaxFileUpload_error = "Error";             
            }
        </script>
    </head>
    <body>
        <form id="form1" runat="server">
            <ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1"
                runat="server" EnableScriptGlobalization="true">            
            </ajaxToolkit:ToolkitScriptManager>
            <div>
                <ajaxToolkit:AjaxFileUpload
                    ID="AjaxFileUpload1"
                    runat="server"
                    ThrobberID="myThrobber"
                    ContextKeys="fred"
                    AllowedFileTypes="jpg,jpeg"
                    MaximumNumberOfFiles="10"
                    OnUploadComplete="AjaxFileUpload1_UploadComplete" OnUploadStart="AjaxFileUpload1_UploadStart" />
            </div>
        </form>
    </body>
    </html>

    Código cs

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    
    namespace WebApplication1
    {
        public partial class WebForm3 : System.Web.UI.Page
        {
            protected void Page_Load(object sender, EventArgs e)
            {
    
            }
    
           
    
            protected void AjaxFileUpload1_UploadStart(object sender, AjaxControlToolkit.AjaxFileUploadStartEventArgs e)
            {
                           
            }
    
            protected void AjaxFileUpload1_UploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e)
            {
                AjaxFileUpload1.SaveAs(Server.MapPath("~/Fotos/") + e.FileName);
            }
        }
    }


    Fulvio Cezar Canducci Dias


    segunda-feira, 2 de dezembro de 2013 20:08