Hi
Vaquas,
Please make changes as bellow:
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BindCheckboxList();
}
}
private void BindCheckboxList()
{
ConnDeemah.Open();
SqlDataReader nsmDr;
Cmd = "SELECT Convert(varchar, NSM.NationalSalesManagerCode)+ ' - ' + NSM.NationalSalesManagerName + ' / ' + C.CountryName As NationalSalesManagerName, NSM.NationalSalesManagerCode FROM NationalSalesManager NSM INNER JOIN Country C ON NSM.NationalSalesManagerCode = C.NationalSalesManagerCode ORDER BY NationalSalesManagerName";
SqlCommand RCMD = new SqlCommand(Cmd, ConnDeemah);
nsmDr = RCMD.ExecuteReader(CommandBehavior.CloseConnection);
CheckBoxList1.DataSource = nsmDr;
CheckBoxList1.DataTextField = "NationalSalesManagerName";
CheckBoxList1.DataValueField = "NationalSalesManagerCode";
CheckBoxList1.DataBind();
}
protected void Ddl_SelectedIndexChanged(object sender, EventArgs e)
{
if (Ddl.SelectedValue=="1")
{
CheckBoxList1.Visible = true;
}
BindCheckboxList();
}
Please do let me know, if you have any doubt.
Please provide "
Vote" if this would be helpful, and make "
Accept Answer" if this would be correct answer.:rose:
Thanks,
Imdadhusen