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 8778701
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T19:35:42+00:00 2026-06-13T19:35:42+00:00

Please refer the attached screenshot. I have an array of the checkbox and a

  • 0

Checkbox ArrayPlease refer the attached screenshot. I have an array of the checkbox and a button for the post back in ASP.Net page. I have written a function as follows to determine what all check boxes have been checked on the button click event: The following code is a part of the business component which is called from ASP.Net. Please let me know how can I return actionArray back to calling functon in ASP.Net page.

    public void checkBoxValidation(Control parent, string strKey)
    {
        XmlDocument getCyleXML = new XmlDocument();
        string strChkID="", strActionXPath = "",strAction="";
        ArrayList actionArray = new ArrayList();

        // Loop through all the controls on the page  
        foreach (Control c in parent.Controls)
        {
            // Check and see if it's a checkbox. 
            if ((c.GetType() == typeof(CheckBox)))
            {
                // Since its a checkbox, see if this is checked.     
                if (((CheckBox)(c)).Checked == true)
                {
                    // Find the ID of the checkbox
                    strChkID = ((CheckBox)(c)).ID.ToString();
                    getCyleXML = CycleXML(strKey);
                    strActionXPath = "/Actions/Action[checkbox='" + strChkID + "']/*[self::Name]";
                    strAction = getCyleXML.SelectSingleNode(strActionXPath).ToString();
                    actionArray.Add(strAction);
                }
            }
            // Now we need to call itself (recursion) because all items (Panel, GroupBox, etc) is a container so we need to check 
            // all containers for any checkboxes.
            if (c.HasControls())
            {
                checkBoxValidation(c, strKey);
            }
        }
    }
  • 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-06-13T19:35:43+00:00Added an answer on June 13, 2026 at 7:35 pm

    The code should be like this :

    public ArrayList checkBoxValidation(Control parent, string strKey, ArrayList actionArray)
    {
        XmlDocument getCyleXML = new XmlDocument();
        string strChkID="", strActionXPath = "",strAction="";
        if(actionArray == null) { actionArray = new ArrayList(); }
    
        // Loop through all the controls on the page  
        foreach (Control c in parent.Controls)
        {
            // Check and see if it's a checkbox. 
            if ((c.GetType() == typeof(CheckBox)))
            {
                // Since its a checkbox, see if this is checked.     
                if (((CheckBox)(c)).Checked == true)
                {
                    // Find the ID of the checkbox
                    strChkID = ((CheckBox)(c)).ID.ToString();
                    getCyleXML = CycleXML(strKey);
                    strActionXPath = "/Actions/Action[checkbox='" + strChkID + "']/*self::Name]";
                    strAction = getCyleXML.SelectSingleNode(strActionXPath).ToString();
                    actionArray.Add(strAction);
                }
            }
            // Now we need to call itself (recursion) because all items (Panel, GroupBox, etc) is a container so we need to check 
            // all containers for any checkboxes.
            if (c.HasControls())
            {
                checkBoxValidation(c, strKey, actionArray);
            }
        }
    
        return actionArray;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Please refer to this post. I have become able to configure my web.config file
Please refer to this page for reference: http://loadedgranola.valitics.com/_product_83484/blackberry_lime I have a jQuery script that
Could you please refer me to an example of an Asp.Net application that would
(Please refer to SQLFiddle for a working example of this post) I have a
Please refer to the post : Display checkbox inside Flash List Control ? (Similar
Please refer the fiddle http://jsfiddle.net/HCqsM/5/ Here By clicking the 'click' link for the first
Please refer my previous post here . I did changes accordingly but getting error.
How does the toggle button on mootools rte work, please refer to example on
please refer to my quick diagram attached below. what i'm trying to do is
Please refer to http://jsfiddle.net/7FfMd/6/ run the code, then select E from the drop down,

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.