Javascript Event Handlers

2 posts, 0 answers
  1. Justin McMillen
    Justin McMillen avatar
    20 posts
    Member since:
    Aug 2009

    Posted 14 Sep 2009 Link to this post

     I was wondering if someone could tell me how to access the name of the uploaded file with javascript.  I have the following javascript code:

    function onLoad(){
        var slCtl = document.getElementByID("Uploader");

        slCtl.Content.Uploader.FileUploaded = FileUploaded;

    function FileUploaded(sender, args) {
       var fileName = args.SelectedFile.Name;

    When I upload a file, I get an error message saying "Object doesn't support the property or method...". 

    In reading the documentation, I see that the RadUploadEventArgs object has a SelectedFile property which has a Name property.  What am I doing wrong?
  2. Ivan
    Ivan avatar
    519 posts

    Posted 17 Sep 2009 Link to this post

    Hello Justin,

    I apologize for the late response - we just released the beta of our Q3 controls.

    Your code looks pretty good. Unfortunately the RadUploadSelectedFile type is not scriptable and you can not access the file's name. In order to accomplish your task you should call a javascript method from the Silverlight code with the name of uploaded file.

    Attached you can find a demo project. Please give it a try and let us know if you have more questions.

    All the best,
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top