Asyncupload and Cannot create an object of type 'System.String'

2 posts, 0 answers
  1. Fabio Cirillo
    Fabio Cirillo avatar
    179 posts
    Member since:
    Jan 2010

    Posted 14 Dec 2012 Link to this post

    i've this code:
        <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" height="200px"
            <telerik:RadAsyncUpload ID="RadAsyncUpload1" runat="server" Culture="it-IT"
            OnClientValidationFailed="OnClientValidationFailed" OnClientFileSelected="fileSelected" OnClientFileUploaded="fileUploaded"
    Localization-Remove="Rimuovi" Localization-Select="Cerca" MaxFileSize="5000000">
                    <telerik:FileFilter Description="Images(jpeg;jpg;gif;png)"
                    Extensions="jpg,jpeg,gif,png" />
                <Localization Cancel="Annulla trasferimento" Select="Cerca" Remove="Rimuovi" />

    but when i start the page there is this error: Cannot create an object of type 'System.String[]' from its string representation 'jpg,jpeg,gif,png' for the 'Extensions' property. Why?


  2. Plamen
    Plamen avatar
    2723 posts

    Posted 19 Dec 2012 Link to this post

    Hello Fabio,

    We are aware of this issue(it is observed only in the 2012.3.1205 version of our controls) and it is already fixed (you could test our latest internal build). In case you don't  want to upgrade right now again  you can avoid the exception by removing the filters declaration from mark up and set it from the code behind. Here is an example how it should look like:

    protected void Page_Load(object sender, EventArgs e)
           var filter = new FileFilter();
           filter.Description = "my desc";
           filter.Extensions = new string[2];
           filter.Extensions[0] = "doc";
           filter.Extensions[1] = "jpg";

    Hope this will explain the issue and be helpful. 

    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. DevCraft R3 2016 release webinar banner
Back to Top