DropDownList resets itself (ASP.NET 2.0 AJAX)
I am using VS2005, C#, ASP.NET 2.0 AJAX to develop a web page. I have a UpdatePanel on the form. Inside it, I have two asp:RadioButtons (RB), a asp:DropDownList (DDL) control and a asp:TextBox (TXT) control. Depending on which RB I select, the DDL will be bound to different DataSources (DataTable). When I select an item from the DDL, the TextBox should show the Text of the DDL. So the code so far is...
Defined two static DataTable objects (multiple fields). They are filled in Page_Load if it is not a IsPostBack. AutoPostBack is true for all controls. Defined OnCheckedChanged for the RB. This procedure binds the required datasource to the first DropdownList (DataSource,DataTextField,DataValueField). Implemented OnSelectedIndexChanged to the DDL to execute the code to fill the text.
The problem is this. When I select the RB, the DDL binds correctly. But when I select an item from the DDL, the DDL resets itself and no text is written.
What am I doing wrong?