Click here to Skip to main content
15,885,027 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
#plz help me!!
in one radio button 7 list, if I select one radio button it hide some textbox as well as label also & how link the db also I created a stored proc for this in ssms?
C#
if (rd.SelectedValue == "Individual")
            {
                CN.Enabled = false;
                IC.Enabled = false;
                NB.Enabled = false;
                NOB.Enabled = false;
                EW.Enabled = true;
                DOI.Enabled = false;
                ITR.Enabled = true;
                PC.Enabled = false;
                AT.Enabled = false;
            }

if(rd.SelectedValue == "Individual")
{
                CN.Visible = false;
                IC.Visible = false;
                NB.Visible = false;
                NOB.Visible = false;
                EW.Visible = true;
                DOI.Visible = true;
                ITR.Visible = true;
                PC.Visible = true;
                AT.Visible = true;
}


What I have tried:

ASP.NET
<pre><asp:Label ID="Label1" runat="server" Text="Company Type :" CssClass="txttables"></asp:Label>
                    <asp:RadioButtonList ID="rd" runat="server"  AutoPostBack="true">
                        <asp:ListItem> Partnership</asp:ListItem>
                        <asp:ListItem> LLP</asp:ListItem>
                        <asp:ListItem> Proprietorship</asp:ListItem>
                        <asp:ListItem> Private Limited</asp:ListItem>
                        <asp:ListItem>  Public Ltd</asp:ListItem>
                        <asp:ListItem> HUF</asp:ListItem>
                        <asp:ListItem> Individual</asp:ListItem>
                    </asp:RadioButtonList>
                    
                        
                    <br>
                    
                        <asp:label id="CN" runat="server" text=" Company Name :">
                        <asp:textbox id="TextBox8" runat="server" width="121px" cssclass="auto-style12">
                    <br>
                        <asp:label id="IC" runat="server" text="Identification Code :">
                        <asp:textbox id="TextBox6" runat="server" cssclass="auto-style10" width="121px">
                    <br>
                        <asp:label id="NB" runat="server" text="Nature of Business :" cssclass="txttables">
                        <asp:radiobuttonlist id="NOB" runat="server" repeatdirection="Horizontal" height="16px" width="748px">
                            <asp:listitem> Agriculture & Allied Consultation
                            <asp:listitem> Manufacturing
                            <asp:listitem> Wholesale Trading
                            <asp:listitem> Retail Trading 
                            <asp:listitem> Service
                        
                    <br>

                        <asp:label id="EW" runat="server" text="Email/Website :" cssclass="txttables">
                        <asp:textbox id="TextBox7" runat="server" cssclass="auto-style23" textmode="Email" width="117px" style="margin-left: 55px"> 

                   <br>

                        <asp:label id="DOI" runat="server" text=" Date of Incorporation : " cssclass="txttables">
                        <asp:textbox id="TextBox11" runat="server" cssclass="auto-style11" width="121px">
                    <br>
                        <asp:label id="ITR" runat="server" text=" IT Return(Latest) :" cssclass="txttables">
                        <asp:fileupload id="IT_Return" runat="server" allowmultiple="true" width="96px" cssclass="auto-style5">
                    <br>
                        <asp:label id="PC" runat="server" text=" PAN Card :" cssclass="txttables">
                        <asp:textbox id="TextBox9" runat="server" width="118px">  <asp:fileupload id="PAN_Card" runat="server" width="89px" allowmultiple="False" cssclass="auto-style25" height="20px">
                    <br>

                        <asp:label id="AT" runat="server" text=" Annual Turnover(Three Years) :" cssclass="txttables">
                        <asp:fileupload id="Annual_turnover" runat="server" width="84px" allowmultiple="False">
                    <br>

                        <asp:label id="PD" runat="server" text=" Partnership Deed :" cssclass="txttables">
                        <asp:fileupload id="Partnership_deed" runat="server" allowmultiple="true" width="112px" cssclass="auto-style13">
Posted
Updated 30-Sep-20 6:30am
v2
Comments
Richard Deeming 30-Sep-20 3:47am    
You seem to have forgotten to ask a question.
Member 14935968 30-Sep-20 10:47am    
I can't control the radio button while I try these code, can't insert into database also.
How can I do?could you please guide me?

1 solution

You've got the same "if" in both places (i.e. there is no effective "else")

if (rd.SelectedValue == "Individual")
 
Share this answer
 

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