How to make UpdatePanel ignore pressing one button that is inside it?

Buttons inside UpdatePanels are automatically registered as triggers for this UpdatePanel. Is there a way to make UpdatePanel ignore one of them inside the buttons? That is, to make sure that pressing this button does not trigger any postback?

+3
source share
2 answers

You can set UpdateMode='Conditional', then set which buttons you want to call after feedback in the tag <Triggers>. Something like that:

<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
    <Triggers>
        <asp:PostBackTrigger ControlID="button1" />
    </Triggers>
    <ContentTemplate>
        ...
        <asp:Button ID="button1" runat="server" Text="Click Me" />
    </ContentTemplate>
</asp:UpdatePanel>
+3
source

. codebehind, , , .

, clientide, <input type='button'> , <asp:button>.

+1

Source: https://habr.com/ru/post/1729090/


All Articles