protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { lblFotos.Text = oCulture.GetResource("MIsFotos", "lblCargarFotos"); } SampleAsyncUploadConfiguration config = RadAsyncUpload1.CreateDefaultUploadConfiguration <SampleAsyncUploadConfiguration>(); config.UserID = sUID; RadAsyncUpload1.UploadConfiguration = config; RadAsyncUpload1.HttpHandlerUrl = sUrlPage; RadAsyncUpload1.FileUploaded += new FileUploadedEventHandler(RadAsyncUpload1_FileUploaded); }
protected override IAsyncUploadResult Process(UploadedFile file, HttpContext context, IAsyncUploadConfiguration configuration, string tempFileName) { // Call the base Process method to save the file to the temporary folder // base.Process(file, context, configuration, tempFileName); // Populate the default (base) result into an object of type SampleAsyncUploadResult SampleAsyncUploadResult result = CreateDefaultUploadResult <SampleAsyncUploadResult>(file); string userID = string.Empty; // You can obtain any custom information passed from the page via casting the configuration parameter to your custom class SampleAsyncUploadConfiguration sampleConfiguration = configuration as SampleAsyncUploadConfiguration; if (sampleConfiguration != null) { userID = sampleConfiguration.UserID; } // Populate any additional fields into the upload result. // The upload result is available both on the client and on the server result.ImageID = InsertImage(file, userID); return(result); }