B
bryan
Hi all,
I am developing a web app in .net 2.0.
I have a few DropDownLists that are used on multiple web forms, these
show shop locations and employees.
Each DDL is placed inside a Usercontrol and the user controls are
placed on the relevant pages.
In order to get at some of the properties of the DDLs from their host
web forms I have written methods and properties like the following -
public ListItem SelectedItem
{
get { return DDL_Employee.SelectedItem; }
}
public IDataReader DataSource // set the data source od the DDL
{
get { return _dataSource; }
set { _dataSource = value; }
}
public void Employee_DDL_Load(ref string MessageText)
{
IDataReader myCategories = null;
CommonHelper.ExecuteCommonReader(ref myEmployee,
"ES_Employee_GetEmployees", ref MessageText);
DDL_Employee.DataTextField = "Employee";
DDL_Employee.DataValueField = "EmployeeID";
DDL_Employee.DataSource = myCategories;
DDL_Employee.DataBind();
DDL_Employee.Items.Insert(0, new ListItem("-- Select
Employee--", "0"));
}
I am developing a web app in .net 2.0.
I have a few DropDownLists that are used on multiple web forms, these
show shop locations and employees.
Each DDL is placed inside a Usercontrol and the user controls are
placed on the relevant pages.
In order to get at some of the properties of the DDLs from their host
web forms I have written methods and properties like the following -
public ListItem SelectedItem
{
get { return DDL_Employee.SelectedItem; }
}
public IDataReader DataSource // set the data source od the DDL
{
get { return _dataSource; }
set { _dataSource = value; }
}
public void Employee_DDL_Load(ref string MessageText)
{
IDataReader myCategories = null;
CommonHelper.ExecuteCommonReader(ref myEmployee,
"ES_Employee_GetEmployees", ref MessageText);
DDL_Employee.DataTextField = "Employee";
DDL_Employee.DataValueField = "EmployeeID";
DDL_Employee.DataSource = myCategories;
DDL_Employee.DataBind();
DDL_Employee.Items.Insert(0, new ListItem("-- Select
Employee--", "0"));
}