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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T04:47:28+00:00 2026-05-15T04:47:28+00:00

I have an user view model that has the following properties: public User user;

  • 0

I have an user view model that has the following properties:

 public User user;
    public List<Language> Languages;

I send the above model to the view and use html helpers to build the form, so I end up with something like:

<form action="/Users/Edit/5" method="post"><input id="user_UserId" name="user.UserId" type="hidden" value="5" />

First Name

Last Name

Email

<br />
<input id="user_Email" name="user.Email" type="text" value="test@gmail.com" />

Language

–
en

en

Now, I try to read the POST in something that initially was something like :

[AcceptVerbs( HttpVerbs.Post )]

public ActionResult Edit( int UserId, FormCollection form ) {

and cannot get the user.UserId variable, user.FirstName variable etc.

Any idea what needs to be done to be able to read this kind of POST request. I’m kind of reluctant to modifying my ViewModel as it is very simple and easy to maintain as it is.

Thank you.

  • 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-15T04:47:29+00:00Added an answer on May 15, 2026 at 4:47 am

    Apparently the easy answer is to use Prefix, something like:

    public ActionResult Edit([Bind(Prefix="user")] int UserId, FormCollection form ) {
    }

    However, I’m still getting the

    The parameters dictionary contains a
    null entry for parameter ‘UserId’ of
    non-nullable type ‘System.Int32’ for
    method ‘System.Web.Mvc.ActionResult
    Edit(Int32,
    System.Web.Mvc.FormCollection)’

    Any idea how to fix that?

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

Sidebar

Related Questions

I have a model MyModel that has a field expiration_datetime. Every time a user
I have a view user control that can post form. This control can be
1.I have a user that wants to view the current items version history on
I have a model with ImagePath and PDFPath properties. When they click save, that
I have the following model: public class Product { public int Id { get;
I have a partial view where I render, if the user has choosen an
I have db.Model which has several properties as described below: class Doc(db.Model): docTitle =
I have an ASP.NET MVC view which contains checkboxes for user-defined categories. <td><% foreach
Hi I have a view with several User Controls and I pass ViewData to
I have a WinForms application with a view where the user selects a single

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.