Click here to Skip to main content
15,919,613 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear Frnds,

I can't textbox visible false using radiobuttonlist.

How to textbox visible false please help me........
Posted
Comments
Karthik_Mahalingam 19-Feb-14 5:13am    
post your code.

XML
<asp:TextBox ID="textbox1" runat="server"></asp:TextBox>
  <asp:RadioButtonList ID="RadioButtonList1" runat="server" AutoPostBack="true"
      onselectedindexchanged="RadioButtonList1_SelectedIndexChanged">
                  <asp:ListItem>Asp.Net</asp:ListItem>
                  <asp:ListItem>PHP</asp:ListItem>
              </asp:RadioButtonList>


C#
protected void RadioButtonList1_SelectedIndexChanged(object sender, EventArgs e)
      {
          if (RadioButtonList1.SelectedItem.Text == "Asp.Net")
          {
              textbox1.Visible = false;
          }
      }
 
Share this answer
 
v2
Comments
vignesh war 19-Feb-14 5:05am    
i have given like this only but not working..
Amol Jadhao 20-Feb-14 1:17am    
for me it is working
Hi...
See this may its help full 2 u.

C#
<asp:TextBox ID="txtauto" runat="server"></asp:TextBox>
<asp:RadioButtonList ID="rbtLstRating" runat="server" 
            RepeatDirection="Horizontal" RepeatLayout="Table" 
            onselectedindexchanged="rbtLstRating_SelectedIndexChanged" AutoPostBack="True">
                <asp:ListItem Text="Excellent" Value="Excellent"></asp:ListItem>
                <asp:ListItem Text="Very Good" Value="Very Good"></asp:ListItem>
            </asp:RadioButtonList>


C#
protected void rbtLstRating_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (rbtLstRating.SelectedItem.Text == "Excellent")
        {
            txtauto.Visible = false;
        }
        else
        {
            txtauto.Visible = false;
        }
    }


Thank u.
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900