Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I am following along with the umbraco.tv Content API video. It shows how to create a comment (i.e. create a new node of doctype "comment").
Previously, in the "contact us" form videos (aka Surface Controllers) I had to set up a model for the form. However, I am now getting my form to populate a doctype (which therefore already has a model).
So, do I need to create a new model for the form (i.e. @model namespace.model.NewModelName)?
Or can I reference the existing model?
If so, do I use the standard view opening: @inherits umbraco.Web.Mvc.UmbracoViewPage<DocTypeAlias>
addendum: I have tried to use
This works ok for the form.
But when I have this in the surface controller for the action
public ActionResult HandleFormSubmit(Umbraco.Web.PublishedModels.myDoctypeAlias model)
I get a binding error (YSoD - Cannot bind (current page model) to Umbraco.Web.PublishedModels.myDoctypeAlias
I have encountered the same error as you, does anyone have a solution?
For what it's worth, I ended up having to create a redundant model. Not that it wouldn't work using the doctype model, I just couldn't get it to do so.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted