This project has moved. For the latest updates, please go here.

I need a javascript function say "BeforeUpload" registered......

Aug 23, 2009 at 3:43 AM

Dear Michael, you have a lot of javascript functions registered in PluginLoaded. But I need a BeforeUploaded function to be registed, so that that just before uploading, a dynamic value from a dropdownlist can be passed to ashx...

If I just write "slCtl.Content.Files.CustomParams = "custom_id=1" in PluginLoaded, everything is ok...but the param is dynamic.....

the code "slCtl.Content.Files.CustomParams = document.getElementById("DropDownList1").value" written in PluginLoaded can not be executed just before uploading..That's why I am wondering if some code can't be executed just before uploading so that some dynamic string can be passed successfully..Much thanks..and waiting...

Coordinator
Aug 23, 2009 at 11:55 AM

No, this functionality is currently not supported. The way to solve
this is to first upload the files, and save the dropdownlist value on
your own. Then link them afterwards in your database. For example
using a session or guid variable.

Aug 23, 2009 at 3:30 PM

Maybe another way is to set the dropdownlist autopostback=true. When user selects a value, the page will be refreshed and then the javascript function PluginLoaded will be executed. Then "slCtl.Content.Files.CustomParams = document.getElementById("DropDownList1").value" will pass user's selection to ashx file. The only effect is that we have a bad user experience, and we must tell user he/she must first select a value of the dropdownlist then select files to upload since a page refresh will remove all files list in silverlight control.....

Michiel,,,waiting for your update with a new BeforeUpload function...I think you can not make some changes or update with the class file FileCollection.cs, is that right?

Aug 24, 2009 at 3:52 AM
Michiel:
Sorry to bother you.
Now my way to pass a dynamic value to ashx is to set my dropdownlist autopostback=true. Then CustomParams in PluginLoaded can be passed since PluginLoaded can be executed when page refreshed. The only effect is user should first select dropdonwlist value otherwise the file list in silverlight control will be erased. Hehehe.~~~~~`
I have got another problem here . I am from China Beijing, how can make your silverligth control display in Chinese? I have moved necessary files to my website and all works well.

wyanshan
2009-08-24

发件人: mpost
发送时间: 2009-08-23 18:55:17
收件人: wyanshan
抄送:
主题: Re: I need a javascript function say "BeforeUpload" registered......[SLFileUpload:66708]

From: mpost

No, this functionality is currently not supported. The way to solve
this is to first upload the files, and save the dropdownlist value on
your own. Then link them afterwards in your database. For example
using a session or guid variable.

Aug 24, 2009 at 3:54 AM
Michiel:
Sorry to bother you.
Now my way to pass a dynamic value to ashx is to set my dropdownlist autopostback=true. Then CustomParams in PluginLoaded can be passed since PluginLoaded can be executed when page refreshed. The only effect is user should first select dropdonwlist value otherwise the file list in silverlight control will be erased. Hehehe.~~~~~`
I have got another problem here . I am from China Beijing, how can make your silverligth control display in Chinese? I have moved necessary files to my website and all works well.

wyanshan
2009-08-24

发件人: mpost
发送时间: 2009-08-23 18:55:17
收件人: wyanshan
抄送:
主题: Re: I need a javascript function say "BeforeUpload" registered......[SLFileUpload:66708]

From: mpost

No, this functionality is currently not supported. The way to solve
this is to first upload the files, and save the dropdownlist value on
your own. Then link them afterwards in your database. For example
using a session or guid variable.

Coordinator
Aug 28, 2009 at 9:45 AM

Hi Wyanshan,

My advise is to split the dropdown functionality and the uploader over two pages and save the state in the database or URL querystring.

I won't be able to make any changes to the control anytime soon. But the source code is available, you can change it if you like.

You can also change the text to Chinese yourself.

Good luck,
Michiel

Dec 2, 2010 at 9:56 PM

Is this still the case? I needed to change the params before hitting upload and between uploads.

Coordinator
Dec 3, 2010 at 8:30 AM

There's currently no BeforeUpload event.