I call this method only at page load event. Here is the code below:
private void load_dropdownlist()
{
DataSet ds1, ds2, ds3, d4 = new DataSet();
//load Project name from project details table
ds1 = PopulateControlsCls.LoadDataSet("Select ProjectID,ProjectName from ProjectDetailsMaster");
drpprojname.Items.Clear();
drpprojname.DataSource = ds1.Tables[0];
drpprojname.DataValueField = "ProjectID";
drpprojname.DataTextField = "ProjectName";
drpprojname.DataBind();
drpprojname.Items.Insert(0, new ListItem("-Select Project-","0"));
////load module name from module_master table
ds2 = PopulateControlsCls.LoadDataSet("Select ModuleID,Module from module_master");
drpmodule.Items.Clear();
drpmodule.DataSource = ds2.Tables[0];
drpmodule.DataValueField = "ModuleID";
drpmodule.DataTextField = "Module";
drpmodule.DataBind();
drpmodule.Items.Insert(0,new ListItem("-Select Module-","0"));
////load user/employee name from login_master table
ds3 = PopulateControlsCls.LoadDataSet("Select LoginID,FName +' ' + LName as Name from login_master");
drpemployee.Items.Clear();
drpemployee.DataSource = ds3.Tables[0];
drpemployee.DataValueField = "LoginID";
drpemployee.DataTextField = "Name";
drpemployee.DataBind();
drpemployee.Items.Insert(0,new ListItem("-Assigned To-","0"));
d4 = PopulateControlsCls.LoadDataSet("Select Taskid,Task from task_master where Module='"+drpmodule.SelectedValue+"' AND ProjectName='"+drpprojname.SelectedValue+"'");
drptask.Items.Clear();
drptask.DataSource = d4.Tables[0];
drptask.DataValueField = "Taskid";
drptask.DataTextField = "Task";
drptask.DataBind();
drptask.Items.Insert(0,new ListItem("-Select Task-","0"));
}