just add
if (!IsPostBack)
{
bind();
}
else
{
}
on page load it will work .
here i have shown how to emb ed cheked changed event in gridview when you are using gridview .
inside the gridview
<asp:TemplateField headertext ="Select">
<ItemTemplate >
<asp:CheckBox ID="chkval" runat="server" AutoPostBack="true" OnCheckedChanged="chkval_CheckedChanged" />
</ItemTemplate>
</asp:TemplateField>
protected void chkval_CheckedChanged(object sender, EventArgs e)
{ //your code
}
0 comments: