I have a page with a dropdown list of employees that populates from a stored procedure, and if the usersID is in the list of employees, their name is the selectedValue for the drop down box when the page loads. (I grab the usersID based on their network login) The problem I'm having is dealing with an employee who is accessing the page but their userID is not in the list of employees. If that is the case, I just want the first name in the list to be selected. The error I'm getting is below. How do I set the selectedvalue equal to the first item in the dropdownlist, if the usersID is not included in the dropdown list?
RequestingEmployee has a SelectedValue which is invalid because it does not exist in the list of items.
Parameter name: value ...
Go to the complete details ...