ImageButton的事件不更新面板内发射 [英] ImageButton event not firing inside Update Panel
问题描述
这是一个排序跟进我的问题在这里:
This is sort of a follow-up to my question here:
<一个href=\"http://stackoverflow.com/questions/534045/asplabel-is-not-shown-when-visible-is-set-to-true\">Asp:Label可见,当设置为true,不显示?
在上面的问题,我曾在这里的知名度没有被设置为false,因为它们在的UpdatePanel
不是一些控件。有一次,我把一个里面的UpdatePanel控件
,能见度来回切换的工作,但是这已经引起了我的另一个问题。我有一个的ImageButton
的出口脱颖而出。当按钮在的UpdatePanel
不是,点击触发的事件,但现在,我把它放在一个的UpdatePanel
里面,单击事件不火。
In the above question, I had a few controls where the visibility was not being set to false because they were not in an UpdatePanel
. Once I put the controls inside an UpdatePanel
, the toggling of visibility worked, but this has caused me another problem. I have an ImageButton
that exports to excel. When the button was not in an UpdatePanel
, the click event fired, but now that I put it inside an UpdatePanel
, the click event does not fire.
我也有正常工作下拉。我想它是与事实,即的ImageButton
不具有的AutoPostBack
属性。
I also have a dropdown which works fine. I am thinking it has something to do with the fact that the ImageButton
does not have an AutoPostBack
property.
推荐答案
请确保您有关联的图像按钮就在UpdatePanel一个PostBackTrigger。如果你正在使用类似的东西来马特Berseth的方法导出到Excel ,你必须有这个触发器的出口工作。
Make sure that you have associated the Image Button to a PostBackTrigger on the UpdatePanel. If you are exporting to Excel using something similar to Matt Berseth's method, you have to have this trigger for the export to work.
<asp:PostBackTrigger ControlID="ImageButton1"/>
这篇关于ImageButton的事件不更新面板内发射的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!