Hi all,
I have an checkboxlist control i need to avoid to calling a method redundantly...Please check my code
Page Design: <asp:CheckBoxList ID="chkContactDetails" runat="server"
RepeatDirection="Horizontal" AutoPostBack="True"
onselectedindexchanged="chkContactDetails_SelectedIndexChanged">
<asp:ListItem>Contact Details</asp:ListItem>
<asp:ListItem>Horoscope Details</asp:ListItem>
<asp:ListItem>Kundali Details</asp:ListItem>
</asp:CheckBoxList>
Code.cs file checkboxlist_selection changed EVENT for (int i = 0; i < chkContactDetails.Items.Count; i++)
{
if (chkContactDetails.Items[i].Selected == true)
{
if (chkContactDetails.Items[i].Text == "Contact Details")
{
tblContactDetails.Visible = true;
GetContactDetails(CustId);
}
else if (chkContactDetails.Items[i].Text == "Horoscope Details")
{
tblHoroscopeDetails.Visible = true;
GetHoroscopeDetails(CustId);
}
else if (chkContactDetails.Items[i].Text == "Kundali Details")
{
GetKundaliDetails(CustId);
}
}
}
when ever i am selecting the last check box kundali details and then i am selecting and deselecting the other two check boxes at every time it was getting to database and once again calling the function how to avoid this. I need to call the method only once after selection of a specific item..
Join Hands Change lives
Thanks & Regards
Straight Edge Society