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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T19:48:34+00:00 2026-05-10T19:48:34+00:00

Ok, I know how to do this, but I want to know if this

  • 0

Ok, I know how to do this, but I want to know if this is the BEST way.

I have a table called ‘Topics’ which has a list of topics(obv). I have a page with about 20 (+/-10) check boxes with all the different topics a user can subscribe to. I figured the best way to do this is to make a control array of check boxes and populate it on page load.

The issue is that the check boxes are in a unique arrangement, should I place them on the page and then dynamically populate them on load? Is that the best way to do it? I’m not too familiar with control arrays.

Thanks!

  • 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. 2026-05-10T19:48:35+00:00Added an answer on May 10, 2026 at 7:48 pm

    Define what you mean by ‘should I place them on the page’.

    Do you mean Drag’n’Drop them onto the aspx page? If you did that, you have to copies of each one — one set created by the page, and a second created by you which replace the first set.

    How do the number of checkboxes vary (’20 (+/- 10)’)? Are they options coming from a database? Are they fixed, but you just don’t know how many yet?

    One funkey aspect of ControlCollection, is that a control can only be in one at a time. If you were to try:

     ControlCollection cool = new ControlCollection ();  coll.Add(Page.Controls[0]); 

    It will be added to coll, but it will automatically be removed from Page.Controls.

    EDITED: (responding to comment) On your codebehind, create the Checkboxes manually (It’s been a while since I wrote WebForm code, so I’m voguing a bit here), and place the in an array (an array shouldn’t have the problem I mentioned about ControlCollection)

    CheckBox[] boxes = new Checkbox[20]; for(int i =0; i< 20; ++i) {     boxes[i] = new CheckBox();     // do stuff here     Page.Controls.Add(boxes[i]); } 

    Now for the ‘do stuff here’, we need to get them in the right place. There are a number of ways. We can build a <table> around them; we can have <asp:placeholder> controls in the aspx which we add them too; we can set the CSS style position attributes.

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

Sidebar

Related Questions

I don't know the best way to ask this, but let me explain the
I know this is a n00b question but I want to define a variable
I don't know how to code this but i want program to skip or
hello i am little new to all this but i want to know that:
I know this question is probably stoopid. But I just don't want to cause
I don't know if this is possible in MS Access, but what I want
I know there is this post , but I still want to know more
I know how to do this in Ruby, but I want to do this
I've read this question, but I want to know how can I delete the
I don't know if I can use regex for this, but I want to

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.