1

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 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.