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

  • Home
  • SEARCH
  • 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 452469
In Process

The Archive Base Latest Questions

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

I have my checkbox for a bool field like so in my view: =Html.CheckBox(Active,

  • 0

I have my checkbox for a bool field like so in my view:

=Html.CheckBox("Active", ViewData["Active"] != null ? ViewData["Active"] : (ViewData.Model.Active != null ? ViewData.Model.Active : false)

you can forget the fluff if you like:

=Html.CheckBox("Active", ViewData.Model.Active)

..causes the same problem.

when I try to update my model with:

UpdateModel(vacancy, Request.Form.AllKeys);

I get the object array return with two bool fields. ok, so I understand the need for the hidden field. but im using MVC Beta and I believe the post data is not being processed by UpdateModel correctly. i get this error:
System.FormatException "String was not recognized as a valid Boolean."
..when the form posts back sometimes. What i mean by that is that the form works fine, saving true and false states, except when another field on the form is empty. then it complains about the "true,false" value. and that’s fine. I understand that a string "true,false" is not a valid bool but why does it complain sometimes and other times work?

EDIT:
If someone can even suggest another approach to the UpdateModel() method, I’ll look at that. I suspect though that this is something simple I’m missing.

EDIT 2:

This seems to be a known bug in MVC Beta (http://www.codeplex.com/aspnet/WorkItem/View.aspx?WorkItemId=2671&FocusElement=CommentTextBox). Can anyone suggest a workaround?

  • 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-12T22:04:32+00:00Added an answer on May 12, 2026 at 10:04 pm

    Solved in ASP.net MVC 1.0

    (added the answer so we can eliminate the question from Unanswered)

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

Sidebar

Related Questions

So - I have a checkbox <asp:CheckBox ID=chkOrder runat=server Visible='<%#IsCheckBoxVisible() %>' Checked=false OnCheckedChanged=chkOrder_CheckedChanged AutoPostBack=true
I want my website to have a checkbox that users can click so that
I have a checkbox list control on my asp.net web form that I am
I have a checkbox in GridViewColumn which i use for show/change database value. The
T have used checkbox column in gridview. On click of a linkbutton, it should
I have used checkbox column in gridview. I want to check status of that
I want to have a checkbox for terms and conditions, label of which should
I have an asp:checkbox control, and I want to change the visibility of a
I have a gridview that I have added a checkbox column using a templatefield
I have a data grid that has a checkbox item renderer in a cloumn

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.