No error but no upload

Last post 04-17-2009, 12:41 PM by danielrq. 1 replies.
Sort Posts: Previous Next
  •  04-17-2009, 12:15 PM 51212

    No error but no upload

    Hi Guys!
     
    Well...go there!
     
    I´m start develop with ajaxuploader, and in this program i need make a simple upload with size limitation. I´d downloaded the package and put the CuteWebUI.AjaxUploader.dll in the bin directory, the scripts in asp.net page...run the project..
     
    The ajaxuploader button was there...very nice...i did clicked in button, the explorer dialog opened to me, i´m choose the file and the progressbar finished...tchanammmm!
     
    Where is the file? Simple. Not upload nothing!
     
    I discovered that i need put in the code behind on  InitializeComponent()
     
    This code...

    Uploader1.FileUploaded +=
    new UploaderEventHandler(Uploader_FileUploaded);

    But i need import the namespace...you know that this is the point? You can help to how i can use the code above in code be hind
     
    I´m work in 1.1 framework 
     
    Goes here the code:

    HMTL
    1. <%@ Page language="c#" Codebehind="QuestionarioDesligamento.aspx.cs" AutoEventWireup="false" Inherits="ASM.dm.QuestionarioDesligamento" %>   
    2. <%@ Register Namespace="CuteWebUI" Assembly="CuteWebUI.AjaxUploader" TagPrefix="CuteWebUI" %>   
    3. <%@ Register TagPrefix="componentart" Namespace="ComponentArt.Web.UI" Assembly="ComponentArt.Web.UI" %>   
    4. <%@ Register TagPrefix="uc1" TagName="QuestionarioInvoluntario" Src="QuestionarioInvoluntario.ascx" %>   
    5. <%@ Register TagPrefix="uc1" TagName="QuestionarioVoluntario" Src="QuestionarioVoluntario.ascx" %>   
    6. <%@ Register TagPrefix="uc1" TagName="menuprincipal" Src="../components/menuprincipal.ascx" %>   
    7. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >   
    8. <HTML>   
    9.     <HEAD>   
    10.         <title>Questionário de Desligamento</title>   
    11.         <LINK href="../componentart_webui_client/styles/menu/MenuStyle.css" type="text/css" rel="stylesheet">   
    12.         <meta content="C#" name="CODE_LANGUAGE">   
    13.         <meta content="JavaScript" name="vs_defaultClientScript">   
    14.         <meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">   
    15.         <META http-equiv="Content-Type" content="text/html; charset=windows-1252">   
    16.         <LINK href="../componentart_webui_client/styles/menu/MenuStyle.css" type="text/css" rel="stylesheet">   
    17.         <LINK href="../styles/padra.css" type="text/css" rel="stylesheet">   
    18.         <script language="JavaScript" src="../js/padrao.js"></script>   
    19.         <script lang="javascript">   
    20.            
    21.             var s='<%=Session.SessionID%>';   
    22.                
    23.             function Preview(tp ,t ,mp )   
    24.             {   
    25.                 var IDPessoaFisica ;   
    26.                 var strChamada ;   
    27.                 var varDesligamento ;   
    28.                 var varST ;   
    29.                    
    30.                 varDesligamento = document.getElementById('hidDesligamento').value ;   
    31.                 IDPessoaFisica = document.getElementById('hidCodPessoaFisica').value ;    
    32.   
    33.                 if(tp=='VisualizarFormulario')   
    34.                 {   
    35.                        
    36.                     if(varDesligamento == 'I')   
    37.                         strChamada = '../dm/verQuestionarioDesligamento.aspx?tp=i&CDPessoaFisica=' + IDPessoaFisica + '&ativo=false'  
    38.                     else  
    39.                         strChamada = '../dm/verQuestionarioDesligamento.aspx?tp=v&CDPessoaFisica=' + IDPessoaFisica + '&ativo=false';   
    40.   
    41.                     location.href = strChamada ;   
    42.                     //printPreview('PrintView','../dm/verQuestionarioDesliga.aspx');               
    43.                 }   
    44.                 else if(tp=='GerarPDF')   
    45.                 {   
    46.                     varST = 'Desligamento';   
    47.                     geraPreview('PdfView','../cv/gerarDocumento.aspx?tipoPreviw='+t+'&ModuloPreviw='+mp+'&st='+varST+'&tp=v&CDPessoaFisica=' + IDPessoaFisica+'&td='+varDesligamento);   
    48.                 }   
    49.   
    50.             }   
    51.         </script>   
    52.         <script runat="server">   
    53.             void Uploader_FileUploaded(object sender, UploaderEventArgs args)   
    54.             {   
    55.                 Uploader uploader = (Uploader)sender;   
    56.                 //InsertMsg("File uploaded! " + args.FileName + ", " + args.FileSize + " bytes.");   
    57.                    
    58.                 //Copies the uploaded file to a new location.   
    59.                 args.CopyTo("c:\\temp\\"+args.FileName);   
    60.                 //args.CopyTo("C:\\Projetos CPMBraxis\\TMS\\Desenvolvimento\\web\\dm\\files\\"+args.FileName);   
    61.                 //You can also open the uploaded file's data stream.   
    62.                 //System.IO.Stream data = args.OpenStream();   
    63.             }   
    64.         </script>   
    65.     </HEAD>   
    66.     <BODY>   
    67.         <FORM id="Desligamento" method="post" runat="server">   
    68.             <uc1:menuprincipal id="cmpmenuprincipal" runat="server" MenuSiteMapTop="true" SiteMapXmlFile="../components/MenuXml/menuprincipalcv.xml"  
    69.                 ImagesBaseUrl="../componentart_webui_client/styles/menu/images/" DefaultToolBarCssClass="../componentart_webui_client/styles/menu/MenuStyle.css"></uc1:menuprincipal>   
    70.             <TABLE cellPadding="0" width="770" border="0">   
    71.                 <TR>   
    72.                     <TD>   
    73.                         <div>   
    74.                             <CuteWebUI:Uploader runat="server" ID="Uploader1" InsertText="Deseja incluir algum arquivo?">   
    75.                             </CuteWebUI:Uploader>   
    76.                         </div>   
    77.                         <uc1:questionariovoluntario id="ctlQuestVoluntario" runat="server" Visible="True"></uc1:questionariovoluntario>   
    78.                         <uc1:questionarioinvoluntario id="ctlQuestInvoluntario" runat="server" Visible="True"></uc1:questionarioinvoluntario>   
    79.   
    80.                     </TD>   
    81.                 </TR>   
    82.             </TABLE>   
    83.         </FORM>   
    84.     </BODY>   
    85. </HTML>  
    CODE BEHIND

    1. {  
    2.  
    3.         #region Web Form Designer generated code   
    4.         override protected void OnInit(EventArgs e)   
    5.         {   
    6.             //   
    7.             // CODEGEN: This call is required by the ASP.NET Web Form Designer.   
    8.             //   
    9.             InitializeComponent();   
    10.             base.OnInit(e);   
    11.         }   
    12.            
    13.         /// <summary>   
    14.         /// Required method for Designer support - do not modify   
    15.         /// the contents of this method with the code editor.   
    16.         /// </summary>   
    17.         private void InitializeComponent()   
    18.         {       
    19.             this.Load += new System.EventHandler(this.Page_Load);   
    20.             //HERE DONT WORK BECAUSE DONT HAVE THE NAMESPACE
    21.             Uploader1.FileUploaded += new UploaderEventHandler(Uploader_FileUploaded);   
    22.         }  
    23.         #endregion  
  •  04-17-2009, 12:41 PM 51218 in reply to 51212

    Re: No error but no upload

    I found the solution.

    i forgot add the reference in the project.(CuteWebUI)...when i did this...work fine!

    Thanks for the patient and sorry for the inconvenient.

View as RSS news feed in XML