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

Custom AsyncUploadConfiguration Properties not deserializing

1 Answer 80 Views
AsyncUpload
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 10 Jan 2011, 12:11 AM
We have been using version 2010.3.1109.35 since 2010-11-11 without problems, upgraded to version 2010.3.1215.35 on 2010-12-25. The RadAsyncUpload is now failing to deserialize our custom AsyncUploadConfiguration properties.
Sample code below.
ASPX page with the RadAsyncUpload control:
<telerik:RadAsyncUpload runat="server" ID="FilesToUpload" MultipleFileSelection="Automatic"
    HttpHandlerUrl="~/Tracking/FileUpload.ashx" AutoAddFileInputs="true" />

Custom Configuration:
public class CustomConfiguration : AsyncUploadConfiguration
{
    public string UserName { get; set; }
    public long FileNoteID { get; set; }
    public bool SaveContentOnly { get; set; }
}

Initializing configuration in code behind of ASPX page with RadAsyncUpload control
public partial class UploadFiles
{
    protected override void OnInit(EventArgs e)
    {
        base.OnInit(e);
CustomConfiguration config = FilesToUpload.CreateDefaultUploadConfiguration<CustomConfiguration>();
            config.FileNoteID = 1234; // sample ID
            config.UserName = "michael"; // sample user name
            config.SaveContentOnly = true;
            FilesToUpload.UploadConfiguration = config;
    }
}

Code behind of Http handler, our additional properties (UserName, FileNoteID) are not being deserialized here anymore.
public class FileUpload : AsyncUploadHandler
{
    protected override IAsyncUploadResult Process(UploadedFile file, HttpContext context, IAsyncUploadConfiguration configuration, string tempFileName)
    {
        CustomConfiguration config = configuration as CustomConfiguration;
        if (config != null)
        {
            // UserName & FileNoteID come through as "" and 0 with latest release.
            DoSomething(config.UserName, Config.FileNoteID);
        }
    }
}

Can someone please let me know how to resolve this issue? Do we need to change something in our web.config?

Thanks

1 Answer, 1 is accepted

Sort by
0
Accepted
Genady Sergeev
Telerik team
answered on 12 Jan 2011, 10:00 AM
Hi Michael,

This is a known issue with RadAsyncUpload, which we have addressed with latest internal build. Could you please upgrade? Information on how to obtain a latest internal build can be found here.

All the best,
Genady Sergeev
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
AsyncUpload
Asked by
Michael
Top achievements
Rank 1
Answers by
Genady Sergeev
Telerik team
Share this question
or