禁用按钮点击后点击 [英] Disable Button Click after clicking

查看:207
本文介绍了禁用按钮点击后点击的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我上传大文件到Amazon S3与进度条,我Jquery的显示进度条,下面的
每一件事情是工作的罚款,但有两个问题
如果在处理用户在选择另一个文件,或点击上传按钮多次,进度条数增加获得
我已经禁用FileUpload控件按钮上传click事件,但它不是禁用按钮上传控件

I am uploading large file to Amazon S3 with Progress Bar, I am displaying Jquery progress bar, following This Every thing is working fine, but there are two problems If during processing user Select another file or Click Upload button multiple times, the progress bar count get increased I have disabled FileUpload Control on button upload click event, but its not disabling the button upload control

这是我过得怎么样:

protected void btnupload_Click(object sender, EventArgs e)
{
  if (FileVideoUpload.HasFile)
  {
       FileVideoUpload.Enabled = false;
       btnupload.Enabled = false;
       System.Threading.Thread.Sleep(8000);
       //Upload File on Amazon S3
       lblmsg.Text = "Video uploaded Successfully";
       FileVideoUpload.Enabled = true;
       btnupload.Enabled = true;
  }
}

我也试过,但还是按钮没有被禁用

I also tried this,but still button is not disabling

protected void Page_Load(object sender, EventArgs e)
{
    btnupload.Attributes.Add("onclick", " this.disabled = true; " + ClientScript.GetPostBackEventReference(btnupload, null) + ";");
}

我也试过在JS禁用它。
我想禁用这两个控件在处理。

Also I have tried disabling it in JS. I want to disable both controls while processing.

推荐答案

您可以单击事件禁用

 $('#btnupload').on('click',function(){
        $(this).prop('disabled','disabled');
    });

这篇关于禁用按钮点击后点击的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆