CheckBox CheckedChanged Event without startup

The CheckedChanged flag event is fired when auto-retry. Is there a way to fire this event with auto repeat set to false?

+3
source share
3 answers

By postback.
Seriously, how could a fire event without dispatch?

0
source

if you want to fire an event without informing the user that you have made a round trip to the server you can fire the ajax event

<asp:ScriptManager ID="ScriptManager2" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
        <asp:CheckBox runat="server" ID="cb" oncheckedchanged="cb_CheckedChanged">
        </asp:CheckBox>
    </ContentTemplate>
</asp:UpdatePanel>
+1
source

.

OnCheckedChanged proprerty CheckBok object (Control) ASP.NET.

javascript, OnClick="checkboxchanged(this);" , checked:

<asp:CheckBox runat="server" ID="cb" onclick="checkboxchanged(this);" />

function checkboxchanged( sender ) {
    if ( sender.checked ) {
        // clicked and checked
    } else {
        // clicked and unchecked
    }
}
0

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


All Articles