asp.net mvc strongly typed helpers - should your render binding object be the same as your posting object?

前端 未结 7 1436
刺人心
刺人心 2021-01-02 22:52

i see that asp.net mvc 2 has strongly typed helped and looking initially at the way it works i think maybe i am doing something wrong in asp.net mvc 1 in terms of data bindi

7条回答
  •  误落风尘
    2021-01-02 23:30

    Most of the time the auto-binding stuff doesn't fit what I need so I just resort to posting to a formCollection parameter and go manual. If you can use any part of the model binding magic then all the better for you.

    Binding less doesn't mean less data is posted back to the server. All of the input elements in the form will be transmitted, you just wont see them as discrete, strongly typed, "automagic" parameters. If you really want to slim down the post data you have to restrict what input elements are inside the particular form you post. MVC is still HTTP after all...

提交回复
热议问题