|
|
Rank: Member
Groups: Registered
Joined: 10/3/2011 Posts: 13 Location: Spain
|
Hi,
I am trying to automatically clear the file from the fileselector once it's been uploaded so that it can be reset and used again, howvever when I call the clear() method on OnClientUploadFileEnded it stops the file from appearing in the folder.
Which event should I attach to instead?
Thanks
|
|
|
Rank: Member
Groups: Registered
Joined: 10/3/2011 Posts: 13 Location: Spain
|
We're close to being ready to buy a license for your product but we need to know it works perfectly before we make the jump. I have worked out from your samples that I need to catch the complete() event in an AJAX updatePanel to finish the fileupload process without resubmitting the form. However, your example uses the UploadConnector and I'm using the control and the AJAX panel is missing the postback so the entire page reloads. Do I need to use the UploadConnector instead to make this work? Here's the relevant code:
// starts upload once a file has been chosen function onFileAdded(data) { kw("<%=SlickUpload1.ClientID %>").start(); } // cancels a file upload function cancelUpload() { kw("<%=SlickUpload1.ClientID %>").cancel(); } // completes file upload function UploadFinished(data) { kw("<%=SlickUpload1.ClientID %>").complete(); }
<asp:ScriptManager ID="scriptManager" runat="server" EnablePartialRendering="true"> </asp:ScriptManager>
<div id="upload_panel"> <div class="su-progress_bar_container"> <asp:UpdatePanel ID="updatePanel" runat="server" UpdateMode="Conditional"> <ContentTemplate> <kw:slickupload id="SlickUpload1" runat="server" fileselectorstyle="float:left;padding-right:1em" MaxFiles="1" AutoUploadOnSubmit="false" style="overflow: hidden; zoom: 1" AutoCompleteAfterLastFile="false" OnClientUploadFileEnded="UploadFinished" AutoUploadOnPostBack="false" OnClientUploadFileStarted="UploadStarted" OnClientFileAdded="onFileAdded" OnUploadComplete="slickUpload_UploadComplete"> <SelectorTemplate> <div class="selectorText"> <a href="javascript:;"><img src="Images/choose-file.png" alt="choose a file to upload" /></a> </div> </SelectorTemplate> <FileItemTemplate> <kw:FileListElement Element="FileName" runat="server"/> <kw:FileListElement Element="FileSize" runat="server"/> <kw:FileListElement Element="ValidationMessage" runat="server"/> </FileItemTemplate> <ProgressTemplate> <div> <kw:UploadProgressBar runat="server" /> <div class="progressBarText"> <kw:UploadProgressElement Element="PercentCompleteText" runat="server">(calculating)</kw:UploadProgressElement> </div> </div> </ProgressTemplate> </kw:slickupload> <div class="su-cancel_upload"> <asp:ImageButton runat="server" ID="cancelButton" ImageUrl="Images/Cancel-sm.png" style="display:none" OnClientClick="cancelUpload();return false;" /> </div> </ContentTemplate> </asp:UpdatePanel> </div> </div>
|
|
|
Rank: Administration

Groups: Administrators
Joined: 7/7/2005 Posts: 1,586 Location: Scottsdale, AZ
|
I took a look at our postback code. When in an update panel, a partial postback would only be done if an AsyncPostBackTrigger control started the upload.
We've added additional logic to do partial postbacks by default, even if you start the upload manually. Upgrade your dll to the one here: http://krystalware.com/Files/SlickUpload-6.1.2.zip.
Let me know if this works for you.
|
|
|
Rank: Member
Groups: Registered
Joined: 10/3/2011 Posts: 13 Location: Spain
|
Thanks Chris, it works perfectly now.
|
|
|
|
Guest |