Models inheriting RenderModel with Ajax/Surface controllers
Hi,
For the first time I've been doing some testing with Ajax forms passing a model back and forth between a partial view and a surface controller. I've noticed that it fails if I use my ordinary controllers that inherit from RenderModel so I've created an exact replica of that model and renamed it to be able to use it in my Ajax form. Is there a better way to do this so that I can use the same model in both my Ajax form and in my Umbraco pages?
Models inheriting RenderModel with Ajax/Surface controllers
Hi,
For the first time I've been doing some testing with Ajax forms passing a model back and forth between a partial view and a surface controller. I've noticed that it fails if I use my ordinary controllers that inherit from RenderModel so I've created an exact replica of that model and renamed it to be able to use it in my Ajax form. Is there a better way to do this so that I can use the same model in both my Ajax form and in my Umbraco pages?
Did you ever find an answer to this. I'm also wondering.
Do the model you create also require parameters in their constructors? As far as I'm aware the default model binder in MVC cannot handle that.
Can I ask why you need to inherit from the render model?
If it's to access the properties of the Umbraco page then check out my post here:
https://our.umbraco.org/forum/umbraco-7/using-umbraco-7/68071-accessing-currentpage-properties-in-a-partial-which-is-using-a-custom-model
is working on a reply...