I am currently developing a page with ajax Uploader and it is working pretty good. However, i just ran into a problem... After the file is upload completes and
protected void Uploader1_UploadCompleted(object sender, UploaderEventArgs[] args) is executed. The page does a complete refresh which is a problem for me..
I placed the CuteWebUI into a user control ascx i then use the ascx in an aspx page.
Ascx Page
<div style="margin:0px;">
<CuteWebUI:Uploader ID="FileUploader1" ClientIDMode="Static" runat="server" InsertButtonID='Uploader1Insert' ProgressCtrlID='Uploader1Progress' CancelButtonID='Uploader1Cancel' TempDirectory="~/UploaderTemp" ProgressPanelWidth="300" InsertText="Select Image" onuploadcompleted="Uploader1_UploadCompleted" onfileuploaded="Uploader1_FileUploaded" >
<ValidateOption AllowedFileExtensions=".png,.jpg,.bmp,.jpeg,.gif, ," />
<ValidateOption MaxSizeKB="1164" />
</CuteWebUI:Uploader>
<asp:Image runat="server" ID="Uploader1Insert" AlternateText="Upload File" ImageUrl="../Images/upload.png" Style="float:left; margin:0px;" />
<asp:Panel runat="server" ID="Uploader1Progress" BorderColor="Orange" BorderStyle="dashed" BorderWidth="2" Style="float:left; margin:0px; padding:0px; ">
<asp:Label ID="Uploader1ProgressText" runat="server" ForeColor="Firebrick"></asp:Label>
</asp:Panel>
<asp:Image runat="server" ID="Uploader1Cancel" AlternateText="Upload File" ImageUrl="../Images/cancel.png" />
</div>
Aspx Page
<
asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<script src="../Scripts/jquery-1.6.4.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(
function () {
alert(
"page refreshed");
});
</script>
<uc1:Uploader ID="Uploader1" runat="server" />
</
asp:Content>