dropdownlist control

  • Thread starter Thread starter tryer
  • Start date Start date
T

tryer

hi i have two dropdownlist controls on my web form. i
want each to trigger the selectedindexchaged event which
i already set to two different functions implemented in
the code behind (one for each control). unfortunately,
for each events, only one of the two functions is always
invoked by the two controls! any help as to how to ensure
that each control only invokes its own designated
function?
ta
 
Hi,
As I ve understood, you have two controls cA, cB and two functions fA, fB having the DropDownList.SelectedIndexChanged signature. Whether you change the selected item in cA or in cB, always the same function fA handles both of the events.
If so, you should control and change the code block where fA is binded to the cA.SelectedIndexChanged and cB.SelectedIndexChanged. This code block mainly located in the InitializeComponent method created by VS.NET. When you change the code, the resulting code should be like that:
...
cA.SelectedIndexChanged += new System.EventHandler(fA);
....
cB.SelectedIndexChanged += new System.EventHandler(fB);

I hope this helps, Good Luck
 
Hi,
As I ve understood, you have two controls cA, cB and two functions fA, fB having the DropDownList.SelectedIndexChanged signature. Whether you change the selected item in cA or in cB, always the same function fA handles both of the events.
If so, you should control and change the code block where fA is binded to the cA.SelectedIndexChanged and cB.SelectedIndexChanged. This code block mainly located in the InitializeComponent method created by VS.NET. When you change the code, the resulting code should be like that:
...
cA.SelectedIndexChanged += new System.EventHandler(fA);
....
cB.SelectedIndexChanged += new System.EventHandler(fB);

I hope this helps, Good Luck
 
Back
Top