AsyncPostBackTrigger找不到LinkBut​​ton

时间:2012-01-15 16:27:55

标签: asp.net asyncpostbackerror

我的.aspx文件中有这段代码

        

    <asp:UpdatePanel runat="server" ID="UpdatePanel1" UpdateMode="Conditional">
        <ContentTemplate>    
            <asp:PlaceHolder runat="server" ID="Placeholder1" EnableViewState="false"></asp:PlaceHolder>
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="ShowVotePanelBtn" EventName="ShowVoteClick" />
        </Triggers>
    </asp:UpdatePanel>

我收到此错误: Could not find an event named 'ShowVoteClick' on associated control 'ShowVotePanelBtn' for the trigger in UpdatePanel 'UpdatePanel1'

我不明白这个消息。该控件具有相应的单击事件。

有什么想法吗?

1 个答案:

答案 0 :(得分:11)

改为使用:

EventName="Click"

这会引发Click控件的LinkButton事件,如OnClick属性所定义。在您的情况下,您的ShowVoteClick事件。

相关问题