Advertisement

07.15.2008 at 02:15AM PDT, ID: 23565427
[x]
Attachment Details

Radio button asp.net

Asked by R8VI in Visual Studio .NET 2005, Microsoft Visual C#.Net, Microsoft Development

Tags: asp.net, c#

Hi,

this is the asp.net code

 <asp:RadioButton ID="RadioButton1" GroupName="source" runat="server" AutoPostBack="True"  />
            UK
            <br />
            <asp:RadioButton ID="RadioButton2" GroupName="source" runat="server" AutoPostBack="True" />
            Holiday
            <br />
            <asp:Label ID="Label1" runat="server" Text="Label1"></asp:Label>
            <br />
            <asp:Label ID="Label2" runat="server" Text="Label2"></asp:Label>

and this is the c# code

if (RadioButton1.Checked = true)
        {
            Label2.Visible = false;
        }

        if (RadioButton1.Checked = true)
        {
            Label2.Visible = false;
        }

What I want to do is that if the click Radiobutton 1 then only label1 should be visible and if I click radiobutton2 then only label2 should be visible.

Any help is much appreciated in advance.

Thanks,

R8VI Start Free Trial
[+][-]07.15.2008 at 02:23AM PDT, ID: 22005232

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Visual Studio .NET 2005, Microsoft Visual C#.Net, Microsoft Development
Tags: asp.net, c#
Sign Up Now!
Solution Provided By: Chandan_Gowda
Participating Experts: 2
Solution Grade: A
 
 
[+][-]07.15.2008 at 02:28AM PDT, ID: 22005263

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628