You could store the property backed up in the view state
<asp:DropDownList ID="sampleDropDownList" runat="server" AutoPostBack="True" OnSelectedIndexChanged="SampleDropDownList_SelectedIndexChanged">
<asp:ListItem Value="1">Sample 1</asp:ListItem>
<asp:ListItem Value="2">Sample 2</asp:ListItem>
<asp:ListItem Value="3">Sample 3</asp:ListItem>
</asp:DropDownList><br />
public string OldValue {
get {
string _result = "1";
object _o = ViewState["OldValue"];
if (_o != null) {
_result = (string)_o;
}
return _result;
}
set {
ViewState["OldValue"] = value;
}
}
protected void SampleDropDownList_SelectedIndexChanged(object sender, EventArgs e) {
OldValue = sampleDropDownList.SelectedValue;
//do something
}
Please Mark Post that helped you as answer, also include a summary of what solved the problem as it helps others in similar situations