Posted on: 2/12/2014 11:05:35 AM | Views : 595

I would like to write my own EditorFor that injects some htmlProperties into the additionalViewData object.
e.G.: i would like to add "form-control" to the @class property if it exist, or create it if it does not.
Adding "form-control" to the existing property is no proplem, as i can cast it to string and them simply write prop += " form-control".
But what do i have to do if the property does not exist?
I already tried casting it to IDictionary<string, object> as you can do this with dynamic objects, but it failed.

Go to the complete details ...