Saturday, 15 March 2014

javascript - Click Event Unbinded after Server Side Call -


I have a problem on the button click button. Please take a look at the following Javascript code.

$ (function () {UploadBtnDisableEvents (); Function UploadBtnDisableEvents () {var buttonupload = $ ('#' + '& lt;% = imgBtnDocUpload .clientID% & gt;') ; Var txtfile = $ ('#' + ''); var txtname = $ ('#' + '& lt;% = txtDocName.ClientID% & gt;') Click on the button 'upload' ('click', function) {Validtoctolocks (TSTfile, TCTNAN)} {setimout (function () {buttonupload.prop (' Strength ', true); Btnuplod .removeAttr (' href ');}, 10);}}); Var validateControls = function (file, docname) {var inputname = docname.val (); Var inputfile = file.val (); If (input name == "" inputfile == tap = inputfile == "" || inputfile == blank) {return false; } And {return true; }}}});

This code works completely when the page initially loads. When the user clicks on the upload button, the button is disabled and the server is aware of the call. The button is re-enabled at the end of the click button. The purpose of this is to stop the user from clicking the button again. Now when the user clicks on the delete button, this click event which is closed by using the on-line event and when the user again clicks the upload button, disable it Is not done. Please suggest me the way the whole page is removed, in the same way he is not rebooting the button with the incident. Thank you.

Note : If you need more information, please mention in the comments. The controls used for us are song control for AJAX call purpose.

Solving my question What has happened in case of callback, the complete DOM is not loaded, So what I have done, I have registered my UploadBtnDisableEvents function. I wrote this line on the callback button click.

  ClientScript.RegisterStartupScript (Me.GetType), "Javascript", "Javascript: Disable Controls"; True)  

upon completion of callback Re-register my script.


No comments:

Post a Comment