dropdowlistbox in asp.net?

Discussion in 'Digital Media' started by Genistra, Mar 24, 2008.

  1. Genistra Guest

    Genistra
    hai
    for eg: i'm having 5 items in the dropdownlistbox. im checking some conditions
    if dropdownlist1.selectedindex=0 then
    labe1.visible=true
    textbox1.visible=true
    end if
    like wise im checking for 5 items. if i select the 5th item the label box and textbox will be displayed. after selecting 5 then i select 3 means only label3 and textbox3 has to b displayed.but it is not happening..Plese help..I'm doing in asp.net
  2. You should post your code so we may be able to diagnose your problem.

    One suggestion...instead of using IF...THEN statements, you can use a SELECT CASE block. Also, remember that you have to make the other labels and textboxes invisible.

    Select Case dropdownlist1.SelectedIndex

    Case 1
    label1.visible = True
    textbox1.visible = True
    label2.visible = False
    textbox2.visible = False

    Case 2
    label2.visible = True
    textbox2.visible = True
    label1.visible = False
    textbox1.visible = False

    Case 3....

    End Select
Loading...

Share This Page