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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:43:08+00:00 2026-05-25T12:43:08+00:00

I was taking advantage of model binding to populate a particular parameter name in

  • 0

I was taking advantage of model binding to populate a particular parameter name in 3 separate places within an action method signature (2 filter entity parameters and a normal controller action parameter).

i.e.

public ViewResult foo(Entity1 something, Entity2 somethingelse, somefield)

where Entity1 and Entity2 both have somefield within them.

For one request I tested using GET and everything worked fine. For another request I used POST and only the parameter by the exact same name in the action method was populated. The rest of the parameters in the entities were mapped correctly. I tested it with another parameter, and found the same results.

Does ASP.NET MVC only populate one parameter by a particular name for POST requests, but multiple instances of a parameter by a particular parameter name for GET requests? Is this “undefined” behavior and a misuse of the model binder?

  • 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-25T12:43:09+00:00Added an answer on May 25, 2026 at 12:43 pm

    I am quite sure something else is amiss. I just gave it a test with the following

    public class Foo
    {  
        public string Name { get; set; }
    }
    
    public class Bar
    {  
        public string Name { get; set; }
    }
    

    and as controller method:

    [HttpPost]
    public ActionResult Index(Foo bar, Bar foo, string Name)
    {
    
        return View();
    }
    

    and for the view just a simple

    @using (Html.BeginForm("Index", "Home")) { 
    
        @Html.TextBox("Name")
    
        <input type="submit" value="save" />
    }    
    

    and it works as expected, both bar.Name, foo.Name, and Name itself are filled with the value supplied when submitting.

    So no difference between POST and GET.

    To even go further into detail, this is what MVC does, where MethodInfo is an object of type System.Reflection.MethodInfo, which represents the action method about to be executed:

    ParameterInfo[] parameterInfos = MethodInfo.GetParameters();
    var rawParameterValues = 
            from parameterInfo in parameterInfos
            select ExtractParameterFromDictionary(parameterInfo, parameters, MethodInfo);
    

    So for each parameter defined for the given method it will try to retrieve the parameter values from object parameters which is, amongst others, what is supplied by the querystring.

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

Sidebar

Related Questions

http://www.grails.org/1.3.1+Release+Notes Improved Query Caching The findAll query method now supports taking advantage of the
I am trying to build a form in WordPress and taking advantage of all
I'd like to implement a jabber client to connect to facebook but taking advantage
I know LINQ can group by taking advantage of anonymous types, so I though
I think I can write a QObject like this by taking advantage of the
I'm wondering if anyone knows of any software techniques taking advantage of biology? For
I am trying to create a cron job while taking advantage of my current
We were able to solve a high CPU usage problem by taking advantage of
During taking advantage of ANTLR 3.3, I'm changing the current grammar to support inputs
We are working on an ASP.NET MVC 3 project and taking advantage of Razor

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.