Event in DropDownList firing between different instances of user controls

ethelljek

New Member
I have a custom user control with two DropDownLists. Each DropDownList has the Autopostback property set to true. There is functionality to add a new instance of the user control and each new instance is inside a PlaceHolder control (in case it is needed, this design is based on this answer from a previous post)The problem I am having is that if I select an option from DropDownList A in instance 1 of the user control and then I select an option from DropDownList B in instance 2 of the user control, the OnSelectedIndexChanged event of DropDownList A on instance 2 of the user control is fired as well with the same value that was selected on the same DropDownList from instance 1.As an example let's say that the user control has information about cars and the two DropDownLists are color and year:\[quote\]
  • On the first instance of the user control I select the year 2010.
  • I DO NOT select a color in this first instance.
  • On the second instance of the user control I select the color Red.
  • I DO NOT select a year in this second instance.
  • The OnSelectedIndexChanged event of the "Year" DropDownList on the second instance gets fired with the value 2010.
\[/quote\]Any insight of why this might be happening and how to fix it will really be appreciated.Thank you.
 
Back
Top