I'm currently working with a repeater which has some number of drop down lists in it determined by how many items are databound to it. I wanted to add an event to each of these drop down lists in the scenario that a user changes the selected index.
Here is what I have for the repeater (Note that I am doing all of the databinding in the codebhind.):
<ItemTemplate>
<tr>
<td>
<asp:DropDownList ID="DropDownList1" runat="server" Text='<%# Eval("Data") %>' AutoPostBack="True" OnTextChanged="TextChanged">
<asp:ListItem>Hello World</asp:ListItem>
<asp:ListItem>GoodBye Cruel World</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
I am setting the OnTextChanged event here, however I did some experimenting with using the different events. I found that my method will not run when I am using the OnTextChanged or OnSelectedIndexChanged events. However, if I use some other events like OnLoad or OnPreRender, the method I have it set to actually runs.
So in short, why is it that when I put this drop down list in the repeater only SOME of the events seem to work?