upload no longer works with tooltip

Thread is closed for posting
2 posts, 0 answers
  1. bill
    bill avatar
    31 posts
    Member since:
    Sep 2007

    Posted 13 May 2008 Link to this post

    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];

    }

  2. Sophy
    Admin
    Sophy avatar
    636 posts

    Posted 14 May 2008 Link to this post

    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
Back to Top