Justin McMillen
Top achievements
Rank 1
Justin McMillen
asked on 03 Sep 2009, 03:02 PM
Hi,
Is it possible to control the Silverlight file upload control with javascript? I would like to be able to start the upload from javascript. I also need to know when the control has finished uploading the files.
Thanks.
Is it possible to control the Silverlight file upload control with javascript? I would like to be able to start the upload from javascript. I also need to know when the control has finished uploading the files.
Thanks.
6 Answers, 1 is accepted
0
Accepted
Hello Justin,
In Silverlight you can mark a class as ScriptableType and its members as ScriptableMember to indicate that it can be used from JavaScript. The RadUpload is marked with these attributes as well. The only thing you have to do is register an instance of the RadUpload with the HtmlPage. The RadUpload should work as any other scriptable class. If you need, you can find many tutorials about Silverlight / JavaScript interop, here is one:
http://pietschsoft.com/post/2008/06/Silverlight-and-JavaScript-Interop-Basics.aspx
You can start the upload from JavaScript but the user needs to choose the files first as he would normally. There are two events that are raised on completion: FileUploaded and UploadFinished.
Greetings,
Miroslav
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.
In Silverlight you can mark a class as ScriptableType and its members as ScriptableMember to indicate that it can be used from JavaScript. The RadUpload is marked with these attributes as well. The only thing you have to do is register an instance of the RadUpload with the HtmlPage. The RadUpload should work as any other scriptable class. If you need, you can find many tutorials about Silverlight / JavaScript interop, here is one:
http://pietschsoft.com/post/2008/06/Silverlight-and-JavaScript-Interop-Basics.aspx
You can start the upload from JavaScript but the user needs to choose the files first as he would normally. There are two events that are raised on completion: FileUploaded and UploadFinished.
Greetings,
Miroslav
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.
0
Justin McMillen
Top achievements
Rank 1
answered on 04 Sep 2009, 05:26 PM
Hi Miroslav,
This works well. Thanks. I do have one other question, though. Is it possible to hide the "Upload" button on the silverlight control?
This works well. Thanks. I do have one other question, though. Is it possible to hide the "Upload" button on the silverlight control?
0
Hello Justin McMillen,
You need to edit the style of the Upload and modify its control template.
Kind regards,
Valentin.Stoychev
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.
You need to edit the style of the Upload and modify its control template.
Kind regards,
Valentin.Stoychev
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.
0
Justin McMillen
Top achievements
Rank 1
answered on 08 Sep 2009, 03:31 PM
Thanks.
I have downloaded the source code for the silverlight controls. Where can I find the default style for the upload control's control template?
I have downloaded the source code for the silverlight controls. Where can I find the default style for the upload control's control template?
0
Accepted
Hello Justin McMillen,
You can see the template of RadUpload control, when you edit the control in "Blend". For more information you can visit this link
http://www.telerik.com/help/silverlight/radcontrols-for-silverlight-expression-blend-support.html
Please find your attached example.
If you have any question please do not hesitate to ask.
I hope this will help you.
All the best,
Dimitrina
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.
You can see the template of RadUpload control, when you edit the control in "Blend". For more information you can visit this link
http://www.telerik.com/help/silverlight/radcontrols-for-silverlight-expression-blend-support.html
Please find your attached example.
If you have any question please do not hesitate to ask.
I hope this will help you.
All the best,
Dimitrina
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.
0
Justin McMillen
Top achievements
Rank 1
answered on 11 Sep 2009, 05:13 PM
This is a great help.
Thanks.
Thanks.