Where do you put your validation in asp.net mvc 3?

后端 未结 5 1136
逝去的感伤
逝去的感伤 2021-02-03 15:26

One common recommended practice in asp.net mvc is that you should not send your business models to your views.. instead you should create viewmodels specific to each view.

5条回答
  •  旧巷少年郎
    2021-02-03 15:51

    Typically your ViewModel will contain a reference to your Model - a ViewModel is only necessary if you need to display additional information in your view that isn't available in your Model, there is no need to replicate the data already present.

提交回复
热议问题