asp.net mvc - Adding multiple Prefixes to DefaultModelBinder MVC2 -


I've noticed most of the ModelBinding examples, but I can not collect what I'm seeing.

I like this:

  & lt;% = Html.TextBox ("User.FirstName")%> & Lt;% = Html.TextBox ("User.LastName")% & gt;  

To post this method on a post,

  the public performance index (userInputModel input) {}  

Where UserInputModel is

  public class UserInputModel {public string first name {get; Set;} public string LastName {get; Set;}} This conference is to use the class name without "input modal", but I do not want to specify it every time with a bid-attribute, that is: < / P> <<> << >>  Code  

I have tried to override default modellbunder but this does not seem to be this small bit of functionality Find the appropriate place to inject

Binary-attribute can be used at the class level, for each instance of the UserInputModel parameter, duplicate it To avoid having to

====== Edit ======

Just by leaving the prefix with the form or using the bindet, it will be the easiest option on the visual model, but one The option will be to register a custom model binder for the user Interpol module and you will be clearly looking at the prefix that you want.


Comments