如何清除下拉列表控件项 [英] how to clear dropdown list control items
本文介绍了如何清除下拉列表控件项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
<asp:DropDownList ID="ddlcountry" runat="server" CssClass="field_txt" Style="width: 248px;"
OnSelectedIndexChanged="ddlcountry_SelectedIndexChanged" AutoPostBack="True">
<asp:ListItem Selected="True" Value="0">Select Country</asp:ListItem>
</asp:DropDownList>
如何清除ddlcountry dropdownlist控件中除listitem之外的所有项目(即,仅应显示选择国家/地区)
how to clear all the items in ddlcountry dropdownlist control except listitem (i.e, select country should only be displayed)
推荐答案
ddlcountry.Items.Clear()
ddlcountry.Items.Insert(0,"Select Country")
dropdownlist1.items.clear();
在这种情况下,您希望您可以编写其内容
dropdownlist1.items.clear();
In which event u want you can write their it will work
这篇关于如何清除下拉列表控件项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文