Copied to clipboard

Flag this post as spam?

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


  • Martin Griffiths 826 posts 1269 karma points c-trib
    Jun 12, 2014 @ 19:49
    Martin Griffiths
    0

    Custom route question

    Shannon, hopefully you'll pick this up....

    http://shazwazza.com/post/Custom-MVC-routing-in-Umbraco

    Referring to your blog post above

    I've taken a slightly different approach to your example in that I dont want my custom routes to appear at all in the Umbraco UI, I guess almost like a custom app inside my umbraco install. But I DO want to continue to use all of my UI built around what is in the umbraco tree.

    I've used your example to get the root node of my site and use this as my context for getting IPublishedContent which I can then pass into my model (which happens to be a form). The problem now is when I postback the form I get the paramterless constructor object error. This because in the GET i'm newing up my model and inheriting from "RenderModel" in a similar way to your method example. On the POST the model needs to be returned in the form, but this time the constructor has to be paramaterless to work. Unfortunately I cannot pass in the Umbraco context as a base because my custom route is not part of any matched content in the umbraco back office.

    Is there any way I can rectify this?

    Thanks Martin

Please Sign in or register to post replies

Write your reply to:

Draft