From f5ede68d0f9e736779fbf4548152276749f2d787 Mon Sep 17 00:00:00 2001 From: Rick Falkvinge Date: Wed, 27 Sep 2017 08:44:19 +0200 Subject: [PATCH] Work on FileUpload -- added cookies on callback --- Site/Controls/v5/Base/FileUpload.ascx | 10 +++++++++- Site/Controls/v5/Base/FileUpload.ascx.cs | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Site/Controls/v5/Base/FileUpload.ascx b/Site/Controls/v5/Base/FileUpload.ascx index 4d33cf70..a58898fc 100644 --- a/Site/Controls/v5/Base/FileUpload.ascx +++ b/Site/Controls/v5/Base/FileUpload.ascx @@ -1,4 +1,5 @@ <%@ Control Language="C#" AutoEventWireup="True" CodeBehind="FileUpload.ascx.cs" Inherits="Swarmops.Controls.Base.FileUpload" %> +<%@ Import Namespace="System.Net" %> @@ -25,7 +26,7 @@ <% if (!String.IsNullOrEmpty(this.ClientUploadCompleteCallback)) { %> - <%= this.ClientUploadCompleteCallback %>(); + <%= this.ClientUploadCompleteCallback %>("<%= GuidString%>", "<%= Cookie%>"); <% } %> @@ -50,6 +51,13 @@ $('#<%=this.ClientID %>_DivProgressUpload').progressbar({ value: 0 }); // reset in case of previous uploads on this page $('#<%=this.ClientID %>_DivProgressUpload').fadeIn(); data.submit(); + + <% if (!String.IsNullOrEmpty(this.ClientUploadStartedCallback)) + { %> + + <%= this.ClientUploadStartedCallback %>("<%= GuidString%>", "<%= Cookie%>"); + + <% } %> } }); diff --git a/Site/Controls/v5/Base/FileUpload.ascx.cs b/Site/Controls/v5/Base/FileUpload.ascx.cs index 117654da..e13c50c1 100644 --- a/Site/Controls/v5/Base/FileUpload.ascx.cs +++ b/Site/Controls/v5/Base/FileUpload.ascx.cs @@ -36,6 +36,7 @@ namespace Swarmops.Controls.Base public bool HideTrigger { get; set; } public string ClientUploadCompleteCallback { get; set; } public string ClientUploadStartedCallback { get; set; } + public string Cookie { get; set; } protected void Page_Init (object sender, EventArgs e) {