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
- <%@ Page language="c#" Codebehind="QuestionarioDesligamento.aspx.cs" AutoEventWireup="false" Inherits="ASM.dm.QuestionarioDesligamento" %>
- <%@ Register Namespace="CuteWebUI" Assembly="CuteWebUI.AjaxUploader" TagPrefix="CuteWebUI" %>
- <%@ Register TagPrefix="componentart" Namespace="ComponentArt.Web.UI" Assembly="ComponentArt.Web.UI" %>
- <%@ Register TagPrefix="uc1" TagName="QuestionarioInvoluntario" Src="QuestionarioInvoluntario.ascx" %>
- <%@ Register TagPrefix="uc1" TagName="QuestionarioVoluntario" Src="QuestionarioVoluntario.ascx" %>
- <%@ Register TagPrefix="uc1" TagName="menuprincipal" Src="../components/menuprincipal.ascx" %>
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
- <HTML>
- <HEAD>
- <title>Questionário de Desligamento</title>
- <LINK href="../componentart_webui_client/styles/menu/MenuStyle.css" type="text/css" rel="stylesheet">
- <meta content="C#" name="CODE_LANGUAGE">
- <meta content="JavaScript" name="vs_defaultClientScript">
- <meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
- <META http-equiv="Content-Type" content="text/html; charset=windows-1252">
- <LINK href="../componentart_webui_client/styles/menu/MenuStyle.css" type="text/css" rel="stylesheet">
- <LINK href="../styles/padra.css" type="text/css" rel="stylesheet">
- <script language="JavaScript" src="../js/padrao.js"></script>
- <script lang="javascript">
-
- var s='<%=Session.SessionID%>';
-
- function Preview(tp ,t ,mp )
- {
- var IDPessoaFisica ;
- var strChamada ;
- var varDesligamento ;
- var varST ;
-
- varDesligamento = document.getElementById('hidDesligamento').value ;
- IDPessoaFisica = document.getElementById('hidCodPessoaFisica').value ;
-
- if(tp=='VisualizarFormulario')
- {
-
- if(varDesligamento == 'I')
- strChamada = '../dm/verQuestionarioDesligamento.aspx?tp=i&CDPessoaFisica=' + IDPessoaFisica + '&ativo=false'
- else
- strChamada = '../dm/verQuestionarioDesligamento.aspx?tp=v&CDPessoaFisica=' + IDPessoaFisica + '&ativo=false';
-
- location.href = strChamada ;
-
- }
- else if(tp=='GerarPDF')
- {
- varST = 'Desligamento';
- geraPreview('PdfView','../cv/gerarDocumento.aspx?tipoPreviw='+t+'&ModuloPreviw='+mp+'&st='+varST+'&tp=v&CDPessoaFisica=' + IDPessoaFisica+'&td='+varDesligamento);
- }
-
- }
- </script>
- <script runat="server">
- void Uploader_FileUploaded(object sender, UploaderEventArgs args)
- {
- Uploader uploader = (Uploader)sender;
-
-
-
- args.CopyTo("c:\\temp\\"+args.FileName);
-
-
-
- }
- </script>
- </HEAD>
- <BODY>
- <FORM id="Desligamento" method="post" runat="server">
- <uc1:menuprincipal id="cmpmenuprincipal" runat="server" MenuSiteMapTop="true" SiteMapXmlFile="../components/MenuXml/menuprincipalcv.xml"
- ImagesBaseUrl="../componentart_webui_client/styles/menu/images/" DefaultToolBarCssClass="../componentart_webui_client/styles/menu/MenuStyle.css"></uc1:menuprincipal>
- <TABLE cellPadding="0" width="770" border="0">
- <TR>
- <TD>
- <div>
- <CuteWebUI:Uploader runat="server" ID="Uploader1" InsertText="Deseja incluir algum arquivo?">
- </CuteWebUI:Uploader>
- </div>
- <uc1:questionariovoluntario id="ctlQuestVoluntario" runat="server" Visible="True"></uc1:questionariovoluntario>
- <uc1:questionarioinvoluntario id="ctlQuestInvoluntario" runat="server" Visible="True"></uc1:questionarioinvoluntario>
-
- </TD>
- </TR>
- </TABLE>
- </FORM>
- </BODY>
- </HTML>
CODE BEHIND
- {
-
- #region Web Form Designer generated code
- override protected void OnInit(EventArgs e)
- {
-
-
-
- InitializeComponent();
- base.OnInit(e);
- }
-
-
-
-
-
- private void InitializeComponent()
- {
- this.Load += new System.EventHandler(this.Page_Load);
- //HERE DONT WORK BECAUSE DONT HAVE THE NAMESPACE
- Uploader1.FileUploaded += new UploaderEventHandler(Uploader_FileUploaded);
- }
- #endregion