Inside an aspx file I have asp:panels under an UpdatePanel
ASPX:
<asp:UpdatePanel ID="UpdatePanel1" runat="server" >
<ContentTemplate>
<asp:Panel ID="PnlTraveler" runat="server" Visible="false">
<input id="chkBoxVisAst" type="checkbox" class="checkbox" enableviewstate="true" />
</asp:Panel>
<ContentTemplate>
</asp"UpdatePanel>
If I write my Jquery codes in the same page under the asp:Content head to work with the click event it doesn't recognize the event id in my case chkBoxVisAst => this id.
JQuery
asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<script type="text/javascript">
$(document).on('ready', function () {
$('#chkBoxVisAst').on('click', function ()
{
if ($(this).attr("checked") == "checked")
{
alert("checked");
} else {
alert("unchecked");
}
});
});
</script>
It works if I put my input(checkbox) outside my panel. How am I going to access my event id from inside the asp:panels?