1

I have in my model a property of a certain type, it's a custom object.

This object takes a string as a ctor argument.

Is it possible to have the model binder automatic insert a string from a form into the ctor of the particular object ?

1 Answer 1

3

yes it is. With a custom model binder, you can explicitly control exactly how values are used to construct your object. This can include route values, form posted values as well as values from the session store.

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

1 Comment

Can give me some hints on this ? I implemented the IModelBinder interface.

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.