Not working in UserControl

2 posts, 0 answers
  1. Kailash
    Kailash avatar
    6 posts
    Member since:
    Jun 2009

    Posted 20 Jun 2010 Link to this post

    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.

  2. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1600 posts

    Posted 24 Jun 2010 Link to this post

    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
Back to Top