在处理和禁用过程中禁用按钮处理后重新启用? [英] Disable Button During Processing & Re-Enable After Processing?

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

问题描述


我在按钮单击事件后面的代码中使用
在此,在逻辑代码(处理)禁用按钮之前
BtnDisplay.Enabled = false;
完成后,启用该按钮

BtnDisplay.Enabled = true;


上面的逻辑不能禁用并启用按钮.

Hi
i use in the code behind button click event
here, before the logic code (processing) disable the button
BtnDisplay.Enabled=false;
after completing that, enable that button

BtnDisplay.Enabled=true;


above logic not disable and enable the button.

推荐答案

我认为您不理解网站会发生什么.

当用户按下按钮时,在服务器上引发click事件,并运行click处理程序.除非您专门与客户交谈,否则在单击处理程序例程完成之前,其UI不会发生任何更改.因此,就客户端而言,禁用按钮,运行时间密集的代码以及重新启用按钮均无济于事.
如果要禁用客户端按钮,则可能需要考虑使用javascript来实现.
I take you you don''t understand what happens with websites then.

When your user presses a button, the click event is raised at the server, and the click handler is run. Unless you specifically talk to the client, no changes will happen to his UI until the click handler routine is completed. So disabling the button, running time intensive code, and re-enabling the button does nothing as far as the client is concerned.
If you want to disable the client button, then you may want to look at using javascript to do it.


这篇关于在处理和禁用过程中禁用按钮处理后重新启用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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