But if i pass in the Model.Content AND a view data and my model inherits from UmbracoViewPage<IPublishedContent> the view is expecting a ViewDataDictionary of type IPublished content.
I looked at doing soemthing like this but it doesnt like it. The ViewData datas its of type string but thinks its an object and @Model.Name is invalid as it thinks Model is a string.
Html.Partial Model and ViewDataDictionary
When you create a Partial you can pass the Model (IPublishedContent) into the partial or you can pass a ViewDataDictionary in there.
However i thought you could pass both as the API has the following method:
But if i pass in the Model.Content AND a view data and my model inherits from UmbracoViewPage<IPublishedContent> the view is expecting a ViewDataDictionary of type IPublished content.
I looked at doing soemthing like this but it doesnt like it. The ViewData datas its of type string but thinks its an object and @Model.Name is invalid as it thinks Model is a string.
Slightly confused now as im sure ive passed in both before.
Can anyone clear this up?
Anyone know how to use this API call?
Like this I believe:
Not 100% sure but your first issue might be just that you need to cast to a string rather than assign it. So rather than:
Try:
Or:
Andy
Doh! Damn intellisense! :)
I was going on what the intellisense was giving me.
Done just this and it works fine. :)
Thanks Andy.
is working on a reply...