开发者

asp.net mvc selectlist

by using selectlist how can i enter the please select. is there a way

 GrpDown = new SelectList(_db.Groups.Where(m => m.vcr_GroupName != "SuperAdmin" &am开发者_开发技巧p;& m.int_Priority >= Authorization.Priority && m.bit_Active == true).ToList(), "int_GroupId", "vcr_GroupName");


I hope I've understoon your question. Try something along these lines:

var ListOfThings = _db.Groups.Where(m => m.vcr_GroupName != "SuperAdmin" && m.int_Priority >= Authorization.Priority && m.bit_Active == true).ToList();

ListOfThings.Insert(0, "Please Select"); // <-- Here you want to enter an item that has the caption "Please Select"

GrpDown = new SelectList(ListOfThings, "int_GroupId", "vcr_GroupName"); 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜