jeudi 23 février 2017

Checkbox inside bootstrap popover not getting unchecked after postback in asp.net

I have made button on which I have put popover. Inside popover I have checkbox which default I have kept checked. Now problem is when I unchecked it it gets checked again automatically.

Demo Link here

<form id="form1" runat="server">
        <asp:ScriptManager ID="sc1" runat="server"></asp:ScriptManager>

        <div id="status3UpdateBox" runat="server" data-placement='bottom' class="btn btn-info">Click Me</div>
        <div id="status3_popover" class="status-popover" style="display: none">
            I am Popover<br />
            <br />
            <asp:UpdatePanel ID="up1" runat="server">
                <ContentTemplate>
                    <asp:CheckBox ID="chk1" runat="server" Text="Check Me" Checked="true" AutoPostBack="true" />
                </ContentTemplate>
            </asp:UpdatePanel>
        </div>


        <script>
            $(document).ready(function () {
                $('#status3UpdateBox').popover({
                    html: true,
                    content: function () {
                        return $('#status3_popover').html();
                    }
                });
            })

            var prm = Sys.WebForms.PageRequestManager.getInstance();
            prm.add_endRequest(function () {
                $('#status3UpdateBox').popover({
                    html: true,
                    content: function () {
                        return $('#status3_popover').html();
                    }
                });
            })
        </script>
    </form>

I have tried same thing without popover then it worked fine. But not working When I keep it inside popover.




Aucun commentaire:

Enregistrer un commentaire