Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7667309
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T15:04:13+00:00 2026-05-31T15:04:13+00:00

hey guys i have these code in my web: <asp:Panel ID=Panel1 runat=server><table> <tr> <td>

  • 0

hey guys i have these code in my web:

<asp:Panel ID="Panel1" runat="server"><table>
      <tr>
           <td>
              <asp:RadioButton ID="rdbParametroExterno" Text="[P] Parametro Externo" runat="server"
                                                    Enabled="False" /><br />
              <asp:RadioButton ID="rdbDatoGeneral" Text="[G] Dato General" runat="server" Enabled="False" /><br />
              <asp:RadioButton ID="rdbFormula" Text="[F] Formula" runat="server" Enabled="False" /><br />
              <asp:RadioButton ID="rdbFormulaAcumulable" Text="[A] Formula Acumulable" runat="server"
                                       Enabled="False" /><br />
            <asp:RadioButton ID="rdbDatoFijo" Text="[D] Dato Fijo" runat="server" Enabled="False" /><br />
            <asp:RadioButton ID="rdbDatoVariable" Text="[V] Dato Variable" runat="server" Enabled="False" /><br />
              <asp:RadioButton ID="rdbFuncionInterna" Text="[I] Funcion Interna" runat="server"
                                                    Enabled="False" /><br />
              <asp:RadioButton ID="rdbTablaSistema" Text="[T] Tabla del Sistema" runat="server"
                                                    Enabled="False" /><br />
           </td>
       </tr>
</table></Panel>

i need to loop through all of them, so i can enable them to true when i click a button, i was trying with a foreach, but it doesnt seem to work, if you could help me that’d be cool, thank you!

protected void btnNew_Click(object sender, ImageClickEventArgs e)
{    
foreach (Control c in Panel1.Controls)
    {
        if (c is RadioButton)
        {

            if (((RadioButton)c).Enabled == false)
            {
                ((RadioButton)c).Enabled = true;
            }
        }

    }
 }

i’d really appreciate your help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T15:04:14+00:00Added an answer on May 31, 2026 at 3:04 pm

    I’m assuming your storing all the radio buttons and button inside a form, which is also inside the Panel. Unfortunately there are more sub controls inside the panel than just the radio buttons. Try something like this:

    ASP.NET

        protected void btnNew_Click(object sender, EventArgs e) 
        {
            EnableAllRadioSubControls(Panel1);
        }
    
        protected void EnableAllRadioSubControls(Control ccontrol)
        {
            foreach (Control c in ccontrol.Controls)
            {
                if(c.Controls.Count > 0)
                {
                    EnableAllRadioSubControls(c);
                }else{
                    if (c is RadioButton)
                    {
    
                        if (((RadioButton)c).Enabled == false)
                        {
                            ((RadioButton)c).Enabled = true;
                        }
                    }
                }
    
            }
        }
    

    C#

    <asp:Panel ID="Panel1" runat="server">
    <form id="Form1" runat="server">
    <table>
          <tr>
               <td>
                  <asp:RadioButton ID="rdbParametroExterno" Text="[P] Parametro Externo" runat="server"
                                                        Enabled="False" /><br />
                  <asp:RadioButton ID="rdbDatoGeneral" Text="[G] Dato General" runat="server" Enabled="False" /><br />
                  <asp:RadioButton ID="rdbFormula" Text="[F] Formula" runat="server" Enabled="False" /><br />
                  <asp:RadioButton ID="rdbFormulaAcumulable" Text="[A] Formula Acumulable" runat="server"
                                           Enabled="False" /><br />
                <asp:RadioButton ID="rdbDatoFijo" Text="[D] Dato Fijo" runat="server" Enabled="False" /><br />
                <asp:RadioButton ID="rdbDatoVariable" Text="[V] Dato Variable" runat="server" Enabled="False" /><br />
                  <asp:RadioButton ID="rdbFuncionInterna" Text="[I] Funcion Interna" runat="server"
                                                        Enabled="False" /><br />
                  <asp:RadioButton ID="rdbTablaSistema" Text="[T] Tabla del Sistema" runat="server"
                                                        Enabled="False" /><br />
               </td>
           </tr>
    </table>
    
    <asp:Button ID="btnNew" Text="Clickme" runat="server" onclick="btnNew_Click" />
    </form>
    </asp:Panel>
    

    This will iterate through all the controls until it finds the radio button sub controls and enables them. 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey guys I have a little issue here. I have a panel where I
I have the following front end code: <ajaxToolkit:TabContainer runat=server Height=150px Width=70% ActiveTabIndex=1 OnDemand=true AutoPostBack=false
hey there guys and girls i have this code that saves json as a
Hey guys have her an code where i add an option to a html
Hey guys, I have a problem with a code that I've been writing. I
Hey guys I have a table with a couple of checkboxes, all of those
Hey guys, one more quick question for any experts out there. I have a
Hey guys I have an admin page that checks if you are admin before
Hey guys I have one more question lol. I am using a script that
Hey guys I have an assigned array from mysql results and I simply want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.