有时我想获取 SelectedList 并询问已选择的 Text 项目。所以使用这个例子:
SelectList sl = new SelectList( new[]{
new SelectListItem{ Text="one", Value="1"},
new SelectListItem{ Text="two", Value="2"},
new SelectListItem{ Text="three", Value="3"}
}, "Text", "Value", "2" );
我现在如何向 sl 询问 SelectedItem.Text ?我很惊讶没有一种方法可以做到这一点,或者至少我能看到一种方法。有什么建议么?我是否需要以某种方式进行 IQuery 或 IEnumerate 才能实现它?