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. Advertising

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:
    9,890
    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:
    887
    =?Utf-8?B?YzY3NjIyOA==?=
    Jan 11, 2006
  3. Iceman
    Replies:
    1
    Views:
    442
    Steve Pugh
    Jan 7, 2004
  4. Jay
    Replies:
    5
    Views:
    1,745
    Mr. Arnold
    Jun 29, 2010
  5. Replies:
    5
    Views:
    490
    Roedy Green
    Oct 11, 2012
Loading...

Share This Page