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

Fire browse event with a dedicated button

2 Answers 53 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Suneco
Top achievements
Rank 2
Suneco asked on 06 Jul 2010, 10:17 AM
Hello Telerik people,

I had a question about if its possible to fire the browse event of the radupload with a dedicated button.

<asp:ScriptManager ID="ScriptManager" runat="server" /> 
 
<telerik:RadUpload ID="CVUpload" runat="server" MaxFileInputsCount="1" ControlObjectsVisibility="None" /> 
 
<script type="text/javascript">  
    var a = getRadUpload("<%= CVUpload.ClientID %>");   // this is null  
    var b = $find("<%= CVUpload.ClientID %>");   // this is null  
</script> 

Found a bit code on this site but here it only returns null.

Greetings,
Jeroen Speldekamp

2 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 06 Jul 2010, 11:26 AM
Hello,

I am not sure about fire browse event for RadUpload. But you can access the client object of RadUpload in pageLoad event (or any event of control) by using same code.

 
<script type="text/javascript"
    function pageLoad() { 
        var a = getRadUpload("<%= CVUpload.ClientID %>");   // this is null   
        var b = $find("<%= CVUpload.ClientID %>");   // this is null   
    } 
</script> 

The problem here is that when you initially try to get a reference to the RadUpload, the control is still not fully rendered on the page and that is why getting 'null'.


-Shinu.
0
Suneco
Top achievements
Rank 2
answered on 06 Jul 2010, 02:22 PM
Hello Shinu,

It works didnt even that about that!
Thank you!

Greetings,
Jeroen Speldekamp
Tags
Upload (Obsolete)
Asked by
Suneco
Top achievements
Rank 2
Answers by
Shinu
Top achievements
Rank 2
Suneco
Top achievements
Rank 2
Share this question
or