禁用按钮,然后启用按钮 [英] disable button and then enable button

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

问题描述

我已经用excel和pdf生成报告
所以我用了2个btn

excel和pdf

单击时会在excel中生成excel btn报告
然后单击pdf生成的pdf btn报告

在某些情况下会单击生成的btn excel或btn pdf报告,但是如果用户单击两次btn excel或两次btn pdf应用程序时挂起,则需要花费更多时间

所以我想要的是

在单击btn excel或btn pdf时,都将btn禁用,直到生成报告后以excel或pdf格式生成报告,然后再启用btn.

我曾经用过但没用
onlick excel方法
excelbtn.visible = false
onclick pdf方法
pdfbtn.visible = false

也用过但不起作用
btnexcel.enabled = false;

i have generate report in excel and pdf
so i used 2 btn

excel and pdf

on click excel btn reports generate in excel
and on click pdf btn report generated in pdf

in some case on click btn excel or btn pdf report generated but takes some more time in that time if user click twice btn excel or twice btn pdf application hangs

so what i want is

on click btn excel or btn pdf both btn disable till report generated in excel or in pdf after report generated then both btn enable .

i used but not work
onlick excel method
excelbtn.visible=false
onclick pdf method
pdfbtn.visible=false

also used but not work
btnexcel.enabled=false;

推荐答案

请参阅此

使用ASP.NET按钮服务器控件提交一次 a> [ ^ ]

令人惊叹的ASP.NET一次只能单击按钮 [单击一次按钮 [
see this

Submit Once with an ASP.NET Button Server Control[^]

The amazing ASP.NET "One Time Only Clickable" Button[^]

Click Once Button[^]


hi,

您必须在两次按钮单击中的任何一个上禁用具有不透明性的全屏.因此,单击一个按钮后,没有人可以单击另一个按钮.根据您的谈话,在完成一个过程之前,不能禁用单击按钮.


因此,请尝试一下.


you have to disable full screen with light opacity on any of both button click. So no one can click on another button after one button click. As per your talk after one button click button can''t disabled till process would be completed.


So try it.


看看这篇文章,肯定会给您一些解决方法..

http://www.abstraction.net/content/articles/预防%20double%20form%20submit%20in%20asp.net.htm [
have a look at this article it will surely give u some way out..

http://www.abstraction.net/content/articles/preventing%20double%20form%20submit%20in%20asp.net.htm[^]


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

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