views:

124

answers:

1

I have a Silverlight control on page which has a upload control. the silverlight exposes some events such as

StartUpload() => To start the file upload,

StopUpload() => To stop the file upload if running,

CheckFileStatus() => to check the status of the file upload.

The page has aspx Submit button with onclientclick event and ocClick event.

<asp:Button ID="btn_upload" Text="External Upload" runat="server" OnClientClick="Javascript:StartUpload();"
        OnClick="btn_upload_Click" />

When I click on the aspx Submit Button, the file selected in Silverlight control should be uploaded and after the completion of upload, the Server side event should get called.

I tried for it but was not able to do so.

Please help me out!....

A: 

Try removing "Javascript:" OnClientClick="StartUpload();"

machine elf
I will need the javascript event to Upload the file selected in Silverlight control. The StartUpload() is a handler which tell's the Silverlight to start the File Upload Process. And i want the process to get complete and then only the Server side event should get called.
Shivkant
StartUpload() sounds like a method rather than an event or a handler. You should *consult the documentation* of the uploader you're using to find the method's parameters and samples for it's scriptable methods. You'll most likely want to handle some sort of "FileStatus" event and do your post back once the file is done. One way to prevent an asp:button from posting back is by returning false: OnClientClick="StartSomething(); return false;".Good luck.
machine elf