Which event can I catch the following exception from an ASP.NET Drop Down List?
'ddlNames' has a SelectedValue which is invalid because it does not exist in the list of items.
Parameter name: value
[ArgumentOutOfRangeException: 'ddlNames' has a SelectedValue which is invalid because it does not exist in the list of items.
Parameter name: value]
I understand exactly why this is being thrown; I have an ID I am trying to select in the list that does not exist in the list. I also have code to check for this upon setting the value and preventing the exception.
However, I still would like to handle this exception more gracefully in the future, just in case I do not have the code in place to handle this condition. To this point I have not been able to find where to 'Catch' this exception. Can anyone point me to where this could be trapped?
Thank you,