你如何删除从ASP.NET下拉列表项,而无需了解任何内容 [英] How do you remove items from an ASP.NET Drop Down List without knowing anything about contents
本文介绍了你如何删除从ASP.NET下拉列表项,而无需了解任何内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在ASP.NET中的下拉列表中。
I have a drop down list in ASP.NET.
我想从这个名单除了第一个删除每一个项目。
I want to remove every item from this list apart from the first one.
我看到有上项删除methond,但它不到风度seeem满足我的需求。
I see there is a Remove methond on items but it dosn't seeem to meet my needs.
可以这样做?
推荐答案
你可以抓住的第一个元素,并将其存储在一个局部变量,然后取出所有(Clear方法),最后再添加第一个元素。
you could grab the first element and store it in a local variable, then remove all items (Clear method) and finally add the first element again.
这篇关于你如何删除从ASP.NET下拉列表项,而无需了解任何内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文