I suggest you ...

Allow us to provide an alternate name

Allow us to provide alternate names for input elements using DataAnotation for Model-Properties. Sample:

[AlternateNames(true, "un", "cn")]
public int UserName {get;set;}

So the DefaultModelBinder respects this attribute and searches for "UserName", if not found searches for "un" and finally for "cn".

Helpers like TextBoxFor<> should also consider this attribute. When the first boolean argument is true (force alternate name) the HtmlHelper should choose the first alternate name as the input name ("un") otherwise choose the property name.

This attribute would allow to use models for forms that are posting to pages that are using other technologies or minimize parameter names but keeping meaningful property names.
We are currently migrating from asp.net webforms and a custom presentation layer to mvc and do have to reimplement a lot of stuff in mvc 3 to keep compatibility between the technologies.

Thanks!
Jens

111 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    Jens HofmannJens Hofmann shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    6 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...

      Feedback and Knowledge Base