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

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

    Posted 14 Dec 2012 Link to this post

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

    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?

    Thanks





  2. Plamen
    Admin
    Plamen avatar
    2734 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";
           RadAsyncUpload1.FileFilters.Add(filter);
       }

    Hope this will explain the issue and be helpful. 

    Regards,
    Plamen
    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. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top