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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T21:10:32+00:00 2026-05-11T21:10:32+00:00

I’m using an checkbox on an ASP.NET MVC form like so: <%=Html.CheckBox(AgreeToRules, Model.AgreeToRules)%> The

  • 0

I’m using an checkbox on an ASP.NET MVC form like so:

<%=Html.CheckBox("AgreeToRules", Model.AgreeToRules)%>

The AgreeToRules property on the model is a boolean value. During testing, this all worked fine. However, now that we’ve gone live with this app, I’m seeing a relatively small but significant number of errors with the following messaging:

System.Web.HttpUnhandledException:
Exception of type
‘System.Web.HttpUnhandledException’
was thrown. —>
System.InvalidOperationException: The
parameter conversion from type
‘System.String’ to type
‘System.Boolean’ failed. See the inner
exception for more information. —>
System.FormatException: Y is not a
valid value for Boolean. —>
System.FormatException: String was not
recognized as a valid Boolean.

This appears to happen when the view engine tries to render the form after a post, and the value of the checkbox that is returned from the ValueProvider looks like:

Y,false

OR

N,false

The html that is rendered in the original form looks like:

<input id="AgreeToRules" name="AgreeToRules" type="checkbox" value="true" />
<input name="AgreeToRules" type="hidden" value="false" />

During testing, I expected (and showed) the posted value to look like:

true,false

if checked or

false

if not checked. So where is the N and Y coming from?

I added user agent to the list of information returned from the error handler and it appears (so far) that all of the errors are occuring under windows XP with FF 3.0.10, but that’s exactly what I have tested with and the problem did not exist during testing.

Any thoughts?

  • 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-11T21:10:33+00:00Added an answer on May 11, 2026 at 9:10 pm

    Well I found the problem, and thought I’d post it here in case others encounter it. Certain form fillers will detect the fields using the names I’ve used and try to “fill them” automatically by setting the value to whatever the user has previously used for similarly named fields. Starting late last night, I’m also receiving “UNSUBSCRIBED” and “SUBSCRIBED” as values for a checkbox named “OptIn”.

    So, the form filler changes the value of the checkbox to something and the user checks the box, resulting in the unexpected value being transmitted to the server.

    Any thoughts on dealing with this would be appreciated.

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

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have thousands of HTML files to process using Groovy/Java and I need to
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
I am reading a book about Javascript and jQuery and using one of the
I've got a string that has curly quotes in it. I'd like to replace
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and

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.