Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Peter S 169 posts 587 karma points
    Aug 20, 2014 @ 16:41
    Peter S
    0

    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?

  • suzyb 474 posts 932 karma points
    Jul 24, 2015 @ 13:58
    suzyb
    0

    Did you ever find an answer to this. I'm also wondering.

  • James Jackson-South 489 posts 1747 karma points c-trib
    Jul 24, 2015 @ 14:18
    James Jackson-South
    0

    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.

  • Paul Seal 524 posts 2889 karma points MVP 6x c-trib
    Jul 25, 2015 @ 20:46
    Paul Seal
    0

    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

Please Sign in or register to post replies

Write your reply to:

Draft