I can't seem to get checkAll and uncheckAll linkbutton functionality working using javascript when my gridview is inside updatepanel
<asp:LinkButton ID="LinkButton1" runat="server" Text="Check All" OnClientClick="CheckOrUnCheckAll(true);return false;"></asp:LinkButton>
<asp:LinkButton ID="LinkButton2" runat="server" Text="Uncheck All" OnClientClick="CheckOrUnCheckAll(false);return false;"></asp:LinkButton>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1"
ShowHeaderWhenEmpty="True" EmptyDataText="No Uploads are found" ShowEmptyTable="True"
ShowFooterWhenEmpty="False" Style="margin-top: 20px" OnSelectedIndexChanged="GridView2_SelectedIndexChanged"
OnRowDataBound="GridView2_RowDataBound" OnRowCommand="GridView2_RowCommand" DataKeyNames="Id"
PageSize="8" AllowPaging="True" AlternatingRowStyle-BackColor="#C2D69B">
<AlternatingRowStyle BackColor="#C2D69B"></AlternatingRowStyle>
<Columns>
<asp:TemplateField HeaderText="Select">
<HeaderTemplate>
<asp:CheckBox ID="checkAll" runat="server" onclick="checkAll(this)" AutoPostBack="True" />
</HeaderTemplate>
<ItemTemplate>
<asp:CheckBox ID="CheckBox1" runat="server" onclick="Check_Click(this)" AutoPostBack="True" />
</ItemTemplate>
</asp:TemplateField>