0
最后一个项目
我们有了可以做一个简单的方法是什么,我想出了这里:更简单的方法来获得在下拉列表
int lastDayInList = ddlBirthDay.Items.IndexOf(ddlBirthDay.Items[ddlBirthDay.Items.Count -1]);
我把Last()放在那里。这个解决方案是.NET 3.5。 Last()在asp.net下拉列表中无法识别。你是说这是一种Linq方法吗? – PositiveGuy 2009-10-21 03:21:53
是的,这是一个linq方法。可能是ddlBirthdays.Items不是IEnumerable。另外,不要忘记#include命名空间System.Linq – 2009-10-21 14:14:52