Link to home
Start Free TrialLog in
Avatar of NickMalloy
NickMalloyFlag for United States of America

asked on

Error handling on dropdownlist

I'm trying to use dropdownlist on my page where some of the selectedvalues from old records do not exist. I want to catch the error and not have the whole page blow up.

I've tried this, but it still blows up. What can I do?

 Try
            drpSystem.SelectedValue = drpSystem.Items.IndexOf(drpSystem.Items.FindByValue(s.systemID))
        Catch ex As Exception
            lblSystemInfo.Text = "The system you selected before no longer exists."
        End Try
ASKER CERTIFIED SOLUTION
Avatar of Anil Golamari
Anil Golamari
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial