find if dropdown value was added dynamically

Napolitanke

New Member
Is there a way to determine (after a postback) if a value in a dropdownlist has been added dynamically or is one of the initial values?eg.\[code\]<asp:DropDownList ID="MyDDL" runat="server"> <asp:ListItem>1</asp:ListItem> <asp:ListItem>2</asp:ListItem> <asp:ListItem>3</asp:ListItem></asp:DropDownList>// on postback 1private void AddExtraItemToList(){ if (someCondition) // extra items may or may not be inserted MyDDL.Items.Add("17");}// on postback 2private void RemoveExtraItemsFromList(){ // remove any non-default values from the list... ?}\[/code\]It's obvioulsy trivial to do by coding a list of default values in code behind or something, but it would be neat if you could do the above by querying which values were intial properties and which were generated from viewstate restoration.
 
Back
Top