What is drop down list ? Do you mean a combo box?
Main Topics
Browse All Topicslet say I have a dropdownlist and three list items..
list1
list2
list3
and on some cases I only needed list1 and 2 so took out list3 from the dropdown using Remove..
Now,
how can I say if only dropdown contains list1 and list2 ? but not actually contain list3
probably say if dd1 not contain list3 then do this.. but dont know how to write this with c# ..
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
<asp:DropDownList ID="Method" runat="server"
AutoPostBack="True">
<asp:ListItem Value="0" Selected="True">- Method -</asp:ListItem>
<asp:ListItem Value="1">test1</asp:ListIte
<asp:ListItem Value="3">test2</asp:ListIte
</asp:DropDownList>
that removed 3 from the dd. it is fine...
Method.Items.Remove(Method
I just need to do like you said loop thru and see if lvaue 3 is there or not..
Business Accounts
Answer for Membership
by: Allister_ReidPosted on 2009-11-03 at 21:21:31ID: 25736631
bool HasList3(DropDownList dd)
{
foreach(ListItem li in dd)
if(li.Name = "list3")
return true;
return false;
}