Hello,
I've encountered an odd problem attempting to use the "PostBackUrl" property of the button used to send the postback which causes the uploader to save the file.
Everything works as planned as long as the button is initially enabled. However, if the button starts out disabled then the cross page postback doesn't occur.
This is hard for me to explain clearly so I'm including some code I was testing with. There are two buttons on this page. The only difference between the buttons, besides their ID, is that one button is initially disabled and the other one is enabled. The file is uploaded when either button is clicked. But only the button which is initally enabled sends a response to the second page.
I did notice there was a query in the URL after testing with the disabled button: test.aspx?RadUrid=4ec5a3c0-0503-422b-83d0-743982ca7ffa
I also tried, without luck, the suggestion in this post ASyncUpload Issue? forum post since it was possible the problem was caused by the same factors.
The code-behind for the SECOND page is the following. The code-behind for the first page just sets values for the TemporaryFolder and TargetFolder properties.
The version of the Telerik .dll is: 2010.3.1215.35
Any help or ideas would be greatly appreciated.
Thanks,
I've encountered an odd problem attempting to use the "PostBackUrl" property of the button used to send the postback which causes the uploader to save the file.
Everything works as planned as long as the button is initially enabled. However, if the button starts out disabled then the cross page postback doesn't occur.
This is hard for me to explain clearly so I'm including some code I was testing with. There are two buttons on this page. The only difference between the buttons, besides their ID, is that one button is initially disabled and the other one is enabled. The file is uploaded when either button is clicked. But only the button which is initally enabled sends a response to the second page.
I did notice there was a query in the URL after testing with the disabled button: test.aspx?RadUrid=4ec5a3c0-0503-422b-83d0-743982ca7ffa
I also tried, without luck, the suggestion in this post ASyncUpload Issue? forum post since it was possible the problem was caused by the same factors.
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="test.aspx.vb" Inherits="test" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <telerik:RadScriptManager ID="RadScriptManager1" runat="server"> </telerik:RadScriptManager> <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"> <script type="text/javascript"> //<![CDATA[ function fileUploaded(sender, eventArgs) { var btn = $get("<%= Me.BTN_loadfile.ClientID%>"); if (typeof (btn) != "defined") { btn.disabled = false; } } //]]> </script> </telerik:RadCodeBlock> <telerik:RadProgressManager ID="RPM_importAdmin" runat="server" /> <br /> File to load administrators from (.CSV,.XLS, or .XLSX): <br /> <br /> <telerik:RadAsyncUpload ID="RAU_uploadFile" MaxFileInputsCount="1" MaxFileSize="10485760" InputSize="60" AllowedFileExtensions="csv,xls,xlsx" runat="server" OverwriteExistingFiles="true" OnClientFileUploaded="fileUploaded" > <Localization Select="Browse" /> </telerik:RadAsyncUpload> <br /> <br /> <telerik:RadProgressArea ID="RPA_uploadFile" DisplayCancelButton="true" runat="server"> </telerik:RadProgressArea> <asp:Button ID="BTN_loadfile" runat="server" Text="Should Go" Enabled="false" CausesValidation="false" PostBackUrl="~/test2.aspx"></asp:Button> <asp:Button ID="Button1" runat="server" Text="Goes" CausesValidation="false" PostBackUrl="~/test2.aspx"></asp:Button> <br /> </form> </body> </html>
The code-behind for the SECOND page is the following. The code-behind for the first page just sets values for the TemporaryFolder and TargetFolder properties.
Imports System.IO Imports Telerik.Web.UI Partial Class test2 Inherits System.Web.UI.Page Protected fileUploader As RadAsyncUpload = Nothing Protected Sub Page_PreInit(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreInit If PreviousPage Is Nothing Then If Not IsPostBack Then Me.Label1.Text = "no previous page" End If Else Me.fileUploader = CType(PreviousPage.Form.FindControl("RAU_uploadFile"), RadAsyncUpload) If Me.fileUploader IsNot Nothing AndAlso Me.fileUploader.UploadedFiles.Count > 0 Then Me.Label1.Text = "File: " & Path.Combine(Me.fileUploader.TargetFolder, Me.fileUploader.UploadedFiles(0).FileName) End If End If End Sub End ClassThe version of the Telerik .dll is: 2010.3.1215.35
Any help or ideas would be greatly appreciated.
Thanks,