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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T16:04:26+00:00 2026-05-12T16:04:26+00:00

Hey all, this is a newbie ASP.NET MVC question. I have a view that

  • 0

Hey all, this is a newbie ASP.NET MVC question.

I have a view that has a list of checkboxes and a submit button. On submit it posts to a controller method but I can’t figure out how to get the values of the checkboxes. Also, I can’t figure out how to get model data that I passed into the view when I’m in the post method, I tried using Html.Hidden but that didn’t seem to work.

Here’s the code:
http://pastebin.com/m2efe8a94 (View)
http://pastebin.com/m39ebc6b9 (Controller)

Thanks for any input received,
Justin

  • 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-12T16:04:26+00:00Added an answer on May 12, 2026 at 4:04 pm

    First thing I noticed is that your hidden fields need to be inside your form. Currently in your view, they are above the BeginForm, so they won’t be included in the form submission.

    To get the values of the selected check boxes, add an IsOffered parameter to your OfferTrade Action method.

    public ActionResult OfferTrade(FormCollection result, List<string> IsOffered)
    

    That parameter will contain a list of the ItemId’s for all the checked IsOffered boxes.

    The HtmlHelper’s CheckBox works differently and I don’t like the way it works, so I don’t use it.

    Making the IsOffered parameter type List<int> should also work if your ItemId field is an integer.

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

Sidebar

Related Questions

Hey all, I know that this question has been asked many times in this
Hey all, I'm about to rip my hair out. I have this client that
hey all.i'm newbie at this problem.i have this data in table result: item range_code
Hey all i have this code here on jsfiddle: http://jsfiddle.net/d7UjD/6/ I have 2 problems
Hey all, this is the code i have to check for a day thats
Hey all, i have been trying for a few minutes on this problem and
EDIT: This problem has been solved. See below. Hey all. I'm building an iPhone
Hey all- I have looked this up on here and Google but none of
Hey all. I'll try to make this brief and simple. :) I have 40
Hey all - simple CSS newbie question, but I can't seem to enter the

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.