I just po开发者_JS百科pulated my SelectList variable inside my controller. Is there a way to get the first value of the selectlist into another variable?
thanks, rod.
You can use the ElementAt extension method (need using System.Linq)
var firstElement = selectList.Items.ElementAt(0);
精彩评论