Copied to clipboard

Flag this post as spam?

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


  • Rick 92 posts 278 karma points
    Oct 23, 2014 @ 14:35
    Rick
    0

    Error when submitting Contour form

    Hi,

    I'm sorry to post on here twice in one day!

    I'm using Umbraco 6.1.5 and I'm working on a site where each doctype has its own custom viewmodel and controller.

    In the controller, the viewmodel is assigned to by passing in "RenderModel" and assigning the necessary properties to the view model - it then returns a view passing in this view model.

    One of the properties on the view model is Page Content (bodyText) and I'm writing this out in the view as "@Html.Raw(Model.BodyText)".

    At first, the Contour form didn't display, but in the source code it displayed as "<?UMBRACO_MACRO formguid="321ed126-17a8-449a-8d96-204914a0d778" macroAlias="umbracoContour.RazorRenderForm" />"

    After some research, I changed it from "@Html.Raw(Model.BodyText)" to "@Umbraco.Field("bodyText")" - which then successfully loaded my contour form as expected.

    Ok, so here's my problem - when I submit my contour form, I'm getting this error:

    I don't have a reference to "@inherits UmbracoTemplatePage" on my page because all the binding is all done via the controller - but I suspect this may be a problem? 

    I also cannot add "@inherits UmbracoTemplatePage" because I am already declaring a model on this page via the "@using ViewModels.HomeViewModel" and so get an error.

    Can anyone help?

    Many thanks in advance,

    Rick

  • Tim 1193 posts 2675 karma points MVP 4x c-trib
    Oct 23, 2014 @ 17:11
    Tim
    0

    Hi Rick,

    You could try @inherits Umbraco.Web.Mvc.UmbracoViewPage<ViewModels.HomeViewModel>

    Does that work?

    Regards,

    Tim.

  • Rick 92 posts 278 karma points
    Oct 23, 2014 @ 17:17
    Rick
    0

    Hi Tim,

    Thanks for getting back to me - I've tried this and it still results in the same error message.

    Rick

Please Sign in or register to post replies

Write your reply to:

Draft