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.
精彩评论