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

Not working in UserControl

1 Answer 83 Views
AsyncUpload
This is a migrated thread and some comments may be shown as answers.
Kailash
Top achievements
Rank 2
Kailash asked on 21 Jun 2010, 04:49 AM
Hi,

I am using Telerik AsyncUpload control, I am facing some problems when this control used in the user control.

 

protected

 

void RadAsyncUpload1_FileUploaded(object sender, Telerik.Web.UI.FileUploadedEventArgs e)

 

{

 

try

 

{

Thumbnail.Width =

Unit.Pixel(100);

 

Thumbnail.Height =

Unit.Pixel(100);

 

 

byte[] imageData = new byte[e.File.InputStream.Length];

 

e.File.InputStream.Read(imageData, 0, (

int)e.File.InputStream.Length);

 

Thumbnail.DataValue = imageData;

Session[

"ImageData"] = imageData;

 

Session[

"ImageFileName"] = e.File.FileName;

 

}

 

catch (Exception ex)

 

{

lblError.Text = ex.Message.ToString();

lblError.Visible =

true;

 

}

}

 


//Script
function fileUploaded(sender, args) {

 

$find(

'RadAjaxManager1').ajaxRequest();

 

sender.deleteFileInputAt(0);

}


this script does not execute properly that's why the server side event RadAsyncUpload1_FileUploaded not execute, when i used this control in user control.

 

Please help.

1 Answer, 1 is accepted

Sort by
0
Genady Sergeev
Telerik team
answered on 24 Jun 2010, 10:39 AM
Hello Kailash,

I have tested this code inside  user control and it seems to work. I believe that the server-side event is not firing for other reason. Please make sure that you have AutoEventsWireUp set to true on your user control or make the RadAsyncUpload1_FileUploaded handler to explicitly handles the RadAsyncUpload1.FIleUploaded event.

All the best,
Genady Sergeev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
AsyncUpload
Asked by
Kailash
Top achievements
Rank 2
Answers by
Genady Sergeev
Telerik team
Share this question
or