vb.net web form, combobox pass value in question

Discussion in 'ASP .Net Web Controls' started by BrianDh, Jan 12, 2005.

  1. BrianDh

    BrianDh Guest

    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
     
    BrianDh, Jan 12, 2005
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. tom
    Replies:
    4
    Views:
    10,151
    S. Justin Gengo
    Nov 13, 2003
  2. =?Utf-8?B?YzY3NjIyOA==?=

    how to pass value from first form to second form?

    =?Utf-8?B?YzY3NjIyOA==?=, Jan 11, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    1,017
    =?Utf-8?B?YzY3NjIyOA==?=
    Jan 11, 2006
  3. Jerry
    Replies:
    20
    Views:
    8,483
    Roedy Green
    Sep 9, 2005
  4. Iceman
    Replies:
    1
    Views:
    526
    Steve Pugh
    Jan 7, 2004
  5. venkatagmail
    Replies:
    11
    Views:
    958
    James Kanze
    Oct 3, 2007
  6. Jay
    Replies:
    5
    Views:
    1,979
    Mr. Arnold
    Jun 29, 2010
  7. GavMc
    Replies:
    4
    Views:
    567
    Evertjan.
    Sep 22, 2005
  8. Replies:
    5
    Views:
    665
    Roedy Green
    Oct 11, 2012
Loading...