I’m trying to set the selected values in an asp ListBox webcontrol from a string[] but I’m getting the error
Only assignment, call, decrement, increment and new object expressions can be used as a statement
Here’s what I have so far…
string[] pageRoles = new string[] {"Admin", "Users", "Publisher"};
pageRoles.ToList().ForEach(r => rolesListBox.Items.FindByValue(r).Selected == true);
I believe the problem is you were using a comparison operator instead of assignment.