views:

40

answers:

1

Hi,

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.

Which method of DefaultModelBinder should I override?

Or anybody knows the solution?

l.

+1  A: 

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.

Darin Dimitrov