Button click not working inside update panel

后端 未结 1 959
情深已故
情深已故 2020-12-06 12:11

When I use Button inside Update panel it doesnot fire click event but outside the update panel it works.
here is the code



        
相关标签:
1条回答
  • 2020-12-06 12:39

    Try this

    set ChildrenAsTriggers to true and add EventName="Click" in asp:AsyncPostBackTrigger

    <asp:UpdatePanel ID="updatePanel2" runat="server" UpdateMode="Conditional" 
                    ChildrenAsTriggers="true">
       <ContentTemplate>
        <asp:Button ID="btnBlock" class="Button" Text="BlockCalls" runat="server"       
                     onclick="btnBlock_Click" Enabled="True" Width="100px" />  
       </ContentTemplate>
       <Triggers>
         <asp:AsyncPostBackTrigger ControlID="btnBlock" EventName="Click"/> 
        </Triggers>
    </asp:UpdatePanel>
    
    0 讨论(0)
提交回复
热议问题