Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AsyncPostBackTrigger doesn't find LinkButton

I have this code in my .aspx file

    <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>

And I get this error: Could not find an event named 'ShowVoteClick' on associated control 'ShowVotePanelBtn' for the trigger in UpdatePanel 'UpdatePanel1'.

I don't understand this message. The control has the corresponding click event.

Any idea?

like image 879
Miklós Balogh Avatar asked Jan 15 '12 16:01

Miklós Balogh


1 Answers

Instead use:

EventName="Click"

This will raise your Click event of your LinkButton control, as defined by its OnClick property. In your case, your ShowVoteClick event.

like image 162
Brissles Avatar answered Oct 11 '22 23:10

Brissles