asp:dropdownlistbox code behind to select entry

Discussion in 'ASP .Net Web Controls' started by David A. Beck, Nov 14, 2003.

  1. I have an aspx page with several asp:dropdownlistboxes on it. When I load
    data, I need to set the selected entry in the ddlb. I have a value, but have
    not been successful in setting the text portion of the control.
    (ddlbTest.SelectedItem.Text = "Booga") Do I need to iterate through the ddlb
    to find the index of the value I want and then set the SelectedIndex?
     
    David A. Beck, Nov 14, 2003
    #1
    1. Advertising

  2. Never Mind - fat fingures.


    "David A. Beck" <> wrote in message
    news:...
    > I have an aspx page with several asp:dropdownlistboxes on it. When I load
    > data, I need to set the selected entry in the ddlb. I have a value, but

    have
    > not been successful in setting the text portion of the control.
    > (ddlbTest.SelectedItem.Text = "Booga") Do I need to iterate through the

    ddlb
    > to find the index of the value I want and then set the SelectedIndex?
    >
    >
    >
     
    David A. Beck, Nov 14, 2003
    #2
    1. Advertising

  3. David A. Beck

    MSFT Guest

    Hi David,

    You may try:

    ddlbTest.SelectedValue = "Booga"

    Hope this help,

    Luke
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)
     
    MSFT, Nov 17, 2003
    #3
    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. Ben Miller [msft]

    Re: Code Behind vs. no code behind: error

    Ben Miller [msft], Jun 27, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    643
    Alphonse Giambrone
    Jun 28, 2003
  2. Eduardo M?ndez
    Replies:
    4
    Views:
    504
    Eduardo M?ndez
    Oct 25, 2003
  3. kgs
    Replies:
    2
    Views:
    495
  4. John

    Non-code behind to code behind

    John, Feb 19, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    527
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Feb 19, 2007
  5. Evan Camilleri

    Borderless DropdownListBox/HTML Select on IE

    Evan Camilleri, Sep 7, 2007, in forum: ASP .Net
    Replies:
    10
    Views:
    8,537
    Evan Camilleri
    Sep 11, 2007
Loading...

Share This Page