important consideration because, as you will see later in this chapter, some of our development practices that would work fine during a complete page refresh will not work anymore."
Each time the Dropdownlist posts back to the server, the server processes it like the initial page load. The SelectedIndex will be -1 and the controls id's and text collection empty.
The SelectedIndex event never fires in the following code because the drop down boxes are inside the refreshing update panel .
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="AuxControl.ascx.cs" Inherits="AuxControl" %>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="False" EnableViewState="False">
<ContentTemplate>
<asp:ScriptManagerProxy ID="ScriptManagerProxy2" runat="server" EnableViewState="False">
</asp:ScriptManagerProxy>
<asp:Label ID="Label2" runat="server" Text="Battle Field: "></asp:Label>
<asp:DropDownList ID="BattleFieldList" runat="server" onload="BattleFieldList_Load" onselectedindexchanged="BattleFieldList_SelectedIndexChanged" AutoPostBack="True" onprerender="BattleFieldList_PreRender" EnableViewState="False" >
</asp:DropDownList>
<br />
<asp:Label ID="Label3" runat="server" Text="Web Cam: "></asp:Label>
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" EnableViewState="False" onload="DropDownList1_Load" onprerender="DropDownList1_PreRender" onselectedindexchanged="DropDownList1_SelectedIndexChanged">
</asp:DropDownList>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="BattleFieldList" EventName="SelectedIndexChanged" />
<asp:AsyncPostBackTrigger ControlID="DropDownList1" EventName="SelectedIndexChanged" />
</Triggers></asp:UpdatePanel>