code_junkie

IEnumerable<string> to SelectList, no value is selected

Nov 11th, 2011
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. IEnumerable<string> list = GetTheValues();
  2. var selectList = new SelectList(list, "SelectedValue");
  3.  
  4. IDictionary<string,string> list = GetTheValues();
  5. var selectList = new SelectList(list, "Key", "Value", "SelectedValue");
Add Comment
Please, Sign In to add comment