B
briandh
Hi
I have a web form, using vb.net code behind, with a combo
box populated with a dataset (Name, ID). What I have
found, unlike a windows form, is that if I try to pass a
value (ID) into the combo and that value is not part of
the dataset, the web form blows up.
If (Context.Items("ID") <> "") Then
cboEmployeeID.SelectedValue = Context.Items("ID")
End If
Testing for empty string does help some but there are
times when we have bad data and the ID value will not
match any in the dataset.
Is there a way to trap this so my form does not error out?
Thanks
Brian
I have a web form, using vb.net code behind, with a combo
box populated with a dataset (Name, ID). What I have
found, unlike a windows form, is that if I try to pass a
value (ID) into the combo and that value is not part of
the dataset, the web form blows up.
If (Context.Items("ID") <> "") Then
cboEmployeeID.SelectedValue = Context.Items("ID")
End If
Testing for empty string does help some but there are
times when we have bad data and the ID value will not
match any in the dataset.
Is there a way to trap this so my form does not error out?
Thanks
Brian