This is a migrated thread and some comments may be shown as answers.

upload no longer works with tooltip

1 Answer 106 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
bill
Top achievements
Rank 1
bill asked on 13 May 2008, 11:20 AM
Hello,

  I upgraded from the trial version and the upload control no longer works embedded in a tooltip. The upload will however work outside of the tooltip so i assume the upgrade went as planned. In the code below please note the button inside the tooltip. The onclick event in the .cs is listed as well. Basically what happens is that once the upload button is clicked and i attempt to access the uploaded file i get an error that states null reference. After setting a break point i noticed that the uplaodedfile collection's count property always stays at 0

<telerik:RadToolTip ID="RadToolTip1" Skin="Default" Animation="Resize" runat="server" ManualClose="true"

Sticky="true">

<asp:UpdatePanel runat="server" ID="UpdatePanel1">

<ContentTemplate>

<table class="style4">

<tr>

<td>

</td>

<telerik:RadUpload ID="RadUpload1" EnableEmbeddedSkins = "false" runat="server" AllowedFileExtensions=".jpg,.bmp,.gif,.jpeg,.png"

ControlObjectsVisibility="None" InitialFileInputsCount="1" MaxFileInputsCount="1"

MaxFileSize="1000000" Skin="Desert" />

</tr>

<tr>

<td align="right">

<asp:Button ID="btnBadImageUpload" runat="server" Font-Names="Arial" Font-Size="X-Small"

OnClick="btnBadImageUpload_Click" Text="Upload" />

</td>

</tr>

</table>

</ContentTemplate>

</asp:UpdatePanel>

</telerik:RadToolTip>

-----------------------------------------------------------------.cs file---------------------------------------------

private void UploadNotOkImage()

{

try

{

Telerik.Web.UI.

UploadedFile imageFile = null;

int qaid = (int)ViewState["currentQA"];

if (RadUpload1.UploadedFiles.Count > 0)

{

imageFile = RadUpload1.UploadedFiles[0];

}

1 Answer, 1 is accepted

Sort by
0
Sophy
Telerik team
answered on 14 May 2008, 01:37 PM
Hi Bill,

Thank you for the provided code. I was able to reproduce the problem you experience with the code you have sent us. The problem is due to using the RadUpload control in an UpdatePanel. RadUpload cannot upload files on AJAX callback, it requires a full postback. If you want to use RadUpload inside an update panel you need to temporally disable AJAX at the time upload will be performed. Please, refer to the following links providing some more information on the matter:

For your convenience I have attached a sample page containing a modified version of your code in which the problem does not exist.

Please, let us know if you need further assistance.

Kind regards,
Sophy
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Upload (Obsolete)
Asked by
bill
Top achievements
Rank 1
Answers by
Sophy
Telerik team
Share this question
or