开发者

Asp.Net MVC Custom ModelBinder

I would like to bind a complex object to a view.

I create a custom ModelBinder inherited from DefaultModelBinder so if I post the form I can reach proper data in Controller.

But if I want to send data to the view the data will not be binded.

开发者_StackOverflowWhich method of DefaultModelBinder should I override?

Or anybody knows the solution?

l.


The model binder is not used in the view. It is only used to bind request values to action parameters. HTML helpers are used in the view to generate input fields. So it is those html helpers that might need to be customized to show the proper data from your model.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜