Re: Upload button Enable

  •  08-16-2012, 1:55 AM

    Re: Upload button Enable

    Hi,
     
    Finally i achieved by this way;
     The solution is.
              <script type="text/javascript">
                  var ClickedUploderId = "";
                  function CuteWebUI_AjaxUploader_OnStart() {
                              var uploader1 = document.getElementById("<%= uploader1.ClientID %>");
                              var uploader2 = document.getElementById("<%= uploader2.ClientID %>");
                              var hidden = this;
                              ClickedUploderId = "";
                                  if (hidden.id == "uploader1") {
                                    //if upload1 uploading,disable upload2
                                    uploader2.internalobject.insertBtn.disabled = "disabled";
                                    ClickedUploderId = "upload1";
                                  }
                                  else {
                                    //if upload2 uploading,disable upload1
                                    uploader1.internalobject.insertBtn.disabled = "disabled";
                                    ClickedUploderId = "upload2";
                                  }
                              }
                              function CuteWebUI_AjaxUploader_OnStop() { //  "Cancel All Update" call
                              var uploader1 = document.getElementById("<%= uploader1.ClientID %>");
                              var uploader2 = document.getElementById("<%= uploader2.ClientID %>");   
                                if (ClickedUploderId == "upload1") {
                                        uploader2.internalobject.insertBtn.disabled = "";
                                      }
                                    else
                                    { uploader1.internalobject.insertBtn.disabled = ""; }
                              }
                  </script>
     
    At last,
    protected void uploader1_UploadCompleted (object sender, CuteWebUI.UploaderEventArgs[] args){     Uploader2.InsertButton.Enabled = true;}
     
    Thanks for your help
     
    My one question is,
    var uploader1 = document.getElementById("<%= uploader1.ClientID %>");
     if i declare it above the OnStart method, then i got the runtime javascript errror that Uploader2 is undefined;
    But i moved to inside the method block it is working.
     
    Regards
    Kalees
View Complete Thread