I have a question that seems to be driving me mad. How can I pull a partial view into my home page simple? I just want to reference:
@Html.ThemedPartial(Model, "Latest")
(which is from Articulate blog). However, I am not sure how to do this because I do not know what using directives to include, etc.? Is there an easy way to do this?
Umbraco.Web.Mvc.ModelBindingException: Cannot bind source content type Umbraco.Web.PublishedContentModels.Index to model type Articulate.Models.IMasterModel.
Make sure the model in the partial is the same as the one you use in the Html.Partial. Try making the model in the partial IPublishedContent, this should do the trick for your case. Just try:
@Html.Partial("~/App_Plugins/Articulate/Themes/MyTheme/Views/Partials/Latest.cshtml", Model) and make sure the model in the partial is IPublishedContent
Calling Partial views into homepage
Hi,
I have a question that seems to be driving me mad. How can I pull a partial view into my home page simple? I just want to reference:
@Html.ThemedPartial(Model, "Latest")
(which is from Articulate blog). However, I am not sure how to do this because I do not know what using directives to include, etc.? Is there an easy way to do this?
Hi Bobi,
Try to see this documentation about Partial Views in Umbraco CMS https://our.umbraco.org/documentation/reference/templating/mvc/partial-views
When you need to call a Partial views into homepage template then you can do it like this.
Hope this helps,
/Dennis
Thanks. I even tried:
but had no luck.
When I try:
I get the following error:
I also tried modifying the directives to
But I then get the following error:
Make sure the model in the partial is the same as the one you use in the Html.Partial. Try making the model in the partial IPublishedContent, this should do the trick for your case. Just try:
@Html.Partial("~/App_Plugins/Articulate/Themes/MyTheme/Views/Partials/Latest.cshtml", Model) and make sure the model in the partial is IPublishedContent
is working on a reply...