I'm a beginner at ASP.NET, but I'm trying to fix a bug in an application written by someone else: a drop-down list's selection is not retained across a postback.
Here are what I believe are the relevant parts of the code:
<asp:DataList ... OnItemDataBound="PopulateDropDownList">
...
<FooterTemplate>
<asp:DropDownList ... AutoPostBack="true" OnSelectedIndexChanged="DoSomething"/>
</FooterTemplate>
</asp:DataList>
I believe I could store the current selection in the session, a static variable or somewhere else, but this seems more like a work-around then a solution.