0

I'm using jquery file upload to upload images to asp.net server (http://www.webtrendset.com/2011/06/22/complete-code-example-for-using-blueimp-jquery-file-upload-control-in-asp-net/)

I need to trigger an asp.net event (or click a hidden asp.net button) when the file upload is complete. I try to add code to the done function but I dont get it to work.

Button can not be reached...

 done: function (e, data) {
 document.getElementById('<%=Button1.ClientID%>').click();

2 Answers 2

1

is done function triggered? you can use jquery to click your button like;

$('input[id$=Button1]').click();
Sign up to request clarification or add additional context in comments.

Comments

1

You can try doing this to execute the postback event with javascript:

__doPostBack('<%= Button1.ClientID  %>', '');

I would also recommend using ClientIDMode = static in your web.config so you don't have to programmatically determine the ID of your element.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.