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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T19:49:24+00:00 2026-06-09T19:49:24+00:00

So I have a view similar to this: … <input type=text id=FieldOne /> <input

  • 0

So I have a view similar to this:

...
<input type="text" id="FieldOne" />
<input type="text" id="FieldTwo" />
<input type="text" id="FieldThree" />
...

That mimics this class:

public class Foo{
    public string FieldOne { get; set; }
    public string FieldTwo { get; set; }
    public string FieldThree { get; set; }
}

And an action in the corresponding controller:

[HttpPost]
public ActionResult View(Foo param)
{
   ...
}

When I submit the form, the parameter “param” in the Post action properly copies the values of all the fields that match the class, except for one of them (say, FieldOne). These inputs are generated by Html.TextboxFor().

Is this a idiosyncratic problem or is there something I may be forgetting about?

  • 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-09T19:49:26+00:00Added an answer on June 9, 2026 at 7:49 pm

    Your input boxes are not valid. They should look as follows:

    // Start Form
    <input type="text" id="FieldOne" name="FieldOne" />
    <input type="text" id="FieldTwo" name="FieldTwo" />
    <input type="text" id="FieldThree" name="FieldThree" />
    // End Form
    

    With that said is there any reason why you are not using the Html Helpers? Given your model it would be better to write your form as follows:

    // Start Form
    @Html.TextBoxFor(m => m.FieldOne)
    @Html.TextBoxFor(m => m.FieldTwo)
    @Html.TextBoxFor(m => m.FieldThree)
    // End Form
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a view that looks somewhat similar to this <% using (Html.BeginForm()) {%>
I have a view that uses a strongly typed ViewData similar to this: namespace
In my MVC application I have a View Model that looks similar to this:
I have a view that looks similar to this, SELECT dbo.Staff.StaffId, dbo.Staff.StaffName, dbo.StaffPreferences.filter_type FROM
I have an MVC project similar to this... Model Public Class ItemDetails Public Property
I have a view that I'm trying to filter with something similar to DISTINCT
I have a question that is similar to this SO question , but slightly
I have a question that is similar to this SO question , but slightly
I have a text file similar to this on a remote device: D0-23-DB-31-04-3E%20192.168.4.42%20dnat 68-A8-6D-0C-38-B2%20192.168.4.40%20dnat
I am beginner in rails. I have view that i try to print inside

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.