By method
parameter in Add
and Remove
method if you meant comboBox1_SelectedIndexChanged
and/or comboBox2_SelectedIndexChanged
then solution is
private void Add(ListControl dropDownList, EventHandler handlerMethodName)
{
dropDownList.OnSelectedIndexChanged += handlerMethodName;
//some logic here
}
private void Remove(ListControl dropDownList, EventHandler handlerMethodName)
{
dropDownList.OnSelectedIndexChanged -= handlerMethodName;
//some logic here
}
Please note: It is DropDownList
in ASP.NET
, ComboBox
is for WinForms
applications.
For more refer: MSDN - DropDownList and MSDN - ListControl.SelectedIndexChanged Event