• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 200
  • Last Modified:

Make other objects visible

I have a radiobuttonlist that has 3 values:


I also have a dropdownlist called "product", dropdownlist called "tank" and a textbox called "datetxt".

When the user selects "Product" from the radiolist I want the dropdownlist (product) to be visible and when the user selects from the radiolist "Tank", then I want the dropdownlist (tank) to be visible.  All of these controls, except for the radiolist are not visible on page_load.  The radiobuttonlist has autopostback set to True.  I thought I could write something like this, but it doesn't work.

If RadioButtonList1.SelectedItem.Text = "Product" Then
   product.Visible = True
End If
1 Solution
Have you tried this?

If RadioButton1.Checked = True
  Product.visible = true
End If
Sample for radio buttons....

  Private Sub PickRadio_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadioButton1.Click, RadioButton2.Click, RadioButton3.Click
'Use the tag properities  in the radio button to easily find which button
        Select Case sender.tag
            Case 1
                 product.Visible = True
                tank.Visible = False
                datetxt.Visible = False            
            Case 2
                 product.Visible = False
                 tank.Visible = True
              datetxt.Visible = False            
            Case 3
                product.Visible = False
                tank.Visible = False
                datetxt.Visible = True            
        End Select
    End Sub

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now