why this code is not working........
here iam givin two radio buttons.
if first one is selected one text box is displayed.
if second is selected one text box is displayed .
here my coding is given below please correct it........

If yes.Checked Then
            nicstaff = "Y"
        ElseIf no.Checked Then
            nicstaff = "N"
        End If

 Protected Sub yes_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles yes.CheckedChanged
        If yes.Checked = True Then
            empname.Visible = True
            empname.SelectedItem.Text = "selected"
        End If
    End Sub

    Protected Sub no_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles no.CheckedChanged
        If no.Checked = True Then
            requestedby.Visible = True
            requestedby.Text = "selected"
        End If
    End Sub

  <asp:RadioButton id="yes" Text="Yes" GroupName="nicstaff" checked="true" runat="server"/>&nbsp;
                    <asp:RadioButton id="no" Text="No" GroupName="nicstaff" runat="server"/>

please help me urgent.............

for yes checkedchange also set visible to false for requestedby control & viceversa.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.