asp.net中的事件 [英] Events in asp.net

查看:83
本文介绍了asp.net中的事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有人,
我需要知道,当单击按钮并从该按钮引发该事件时,.net应用程序中的click事件已完成,然后将触发该事件,但是如果单击该按钮然后立即将其移至另一个Button,则将触发哪个按钮事件.是触发第一个被单击的按钮还是第二个被放置的事件.

令人困惑,但有趣.请帮助我. :doh:

Dear All,
I need to know that click event is complete in .net application when button is clicked and raised from that button , then event is fired but if we click the button and then instantaneously we move that button to different Button then which button event will fire.Is the event of first button which is clicked is fired or the second on which the is placed.

Confusing but interesting. Kindly help me. :doh:

推荐答案

您可以简单地对其进行测试并知道是否可行.

但是,如果我正确理解,您的想法是在单击按钮的同时将事件更改为另一个事件.这行不通.这样做的原因是因为UI是一个单线程,并且所有操作都是按顺序进行的.

您可以通过使用mouseenter事件更改按钮的事件来执行类似的操作,因为此事件将在触发点击之前触发.

尚不清楚您可能对此有什么用途.像亨利(Henry)和戴夫(Dave)(以及您自己在内;)一样,这非常令人困惑和模糊,但是希望这可以回答您的问题.

祝你好运!
You could simply test it and know if it is possible.

But if I understand it correctly your idea is to change the event to another event at the same time the button is clicked. This won''t work. The reason for that is because the UI is a single thread and all operations are handled sequential.

You could do something like this by changing the event of a button using the mouseenter event because this event would fire before the click can be fired.

It remains unclear what use you could have for this. Like Henry and Dave (and yourself included ;)) it is pretty confusing and vague but hopefully this answers your question.

Good luck!


这篇关于asp.net中的事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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