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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T13:06:33+00:00 2026-06-09T13:06:33+00:00

I need to display a few checkbox on a form and the user can

  • 0

I need to display a few checkbox on a form and the user can check as many as hey want.

So I store the checkbox options on Database. (required)

Model

public class Options
{
    public int OptionsId {get; set;}
    public string Option {get; set;}
}

On the viewModel,

IEnumerable<Options> listCheckBoxOptions {get; set;}// store list of options from database
Dictionary<string,bool> checkboxs {get; set;} // store if is check or not

So on the view i want to store the check box value (true/false) in this checkboxs dictionary.

@foreach (var x in Model.listCheckBoxOptions)
     {                  
           @Html.CheckBoxFor(m => m.checkboxs[x.Option])
           @m.Option <br />                             
     } 

So when i submit the form… the checkboxs is null when gets to the controller.

Any idea why?

  • 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-09T13:06:34+00:00Added an answer on June 9, 2026 at 1:06 pm

    Your checkboxes will be given names like this checkboxs[key here] and ID’s like this checkboxs_key_here_. MVC doesn’t know how to bind these back.

    Have a look at this thread that I answered just days ago: Generating an MVC3 RadioButton list in a loop statement

    It’s the same thing, just using RadioButtons instead of CheckBoxes.

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

Sidebar

Related Questions

I have a class called Property that I only need to display a few
I need to impl a few basic features in this server: display a nice
I need to simply wrap long text to display it in a few lines.
I need to display image and one button on fancybox popup but I can't
I need to display a time duration on a few of my Activities within
For many of the pages in my site, i need to display the records
I've built a form with a checkbox and a few text fields and I've
I need some modal view on iPhone app where I will display few labels,
I have a few different tables that I want to display vertically down a
I have a database table with images that I need to display. In my

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.