How do you call a partial that you need to exclude from parent Cache, and I need to pass in a value into my controller.
@Html.Action(ActionResultsName, ControllerName, new { valuePassed = "test"}, true)
But it comes back with some error as. I've checked and it works with either only @Html.Action(ActionResultsName, ControllerName, true)
or
@Html.Action(ActionResultsName, ControllerName, new {valuePassed = "test"})
Any help will be great
Type 'Umbraco.Web.PublishedCache.XmlPublishedCache.XmlPublishedContent' cannot inherit from a type that is not marked with DataContractAttribute or SerializableAttribute. Consider marking the base type 'Umbraco.Web.Models.PublishedContentBase' with DataContractAttribute or SerializableAttribute, or removing them from the derived type.
Sorry I've only used it without passing a value to the controller. Since you don't want to cache this part why do you want to pass a value? That value will be cached because it's not part of the excluded part. Can't you fetch that value in the childaction controller?
I've tried fetching the value in the childaction controller using CurrentPage.
The issue is, I'm viewing the homepage with child pages. And one of the child pages comes with an MNTP property that select certain node. I've tried looping this MNTP to call the @Html.Action that ignore from Parent Cache.
But in the childaction controller, when I use CurrentPage, it keeps refering to the homepage that i'm viewing instead of the Node i've selected in the MNTP. Any work around for this that you might encounter?
Thanks a lot. Still kind of new on how the Hybrid Framework works :)
Are you using the built-in output caching, or are you using https://github.com/moonpyk/mvcdonutcaching ? I've had problems with the latter, as it doesn't seem to like complex models (though, maybe the new release has fixed that). One option for complex models would be to serialize them to a string (e.g., using the JSON serializer), and deserialize them in the controller action. Not sure if that's the issue you are having though.
Donut caching question
How do you call a partial that you need to exclude from parent Cache, and I need to pass in a value into my controller.
@Html.Action(ActionResultsName, ControllerName, new { valuePassed = "test"}, true)
But it comes back with some error as. I've checked and it works with either only
@Html.Action(ActionResultsName, ControllerName, true)
or
@Html.Action(ActionResultsName, ControllerName, new {valuePassed = "test"})
Any help will be great
Type 'Umbraco.Web.PublishedCache.XmlPublishedCache.XmlPublishedContent' cannot inherit from a type that is not marked with DataContractAttribute or SerializableAttribute. Consider marking the base type 'Umbraco.Web.Models.PublishedContentBase' with DataContractAttribute or SerializableAttribute, or removing them from the derived type.
Hello,
Sorry I've only used it without passing a value to the controller. Since you don't want to cache this part why do you want to pass a value? That value will be cached because it's not part of the excluded part. Can't you fetch that value in the childaction controller?
Jeroen
Hi Jeroen, was about to email you just now.
Thanks for replying here.
I've tried fetching the value in the childaction controller using CurrentPage.
The issue is, I'm viewing the homepage with child pages. And one of the child pages comes with an MNTP property that select certain node.
I've tried looping this MNTP to call the @Html.Action that ignore from Parent Cache.
But in the childaction controller, when I use CurrentPage, it keeps refering to the homepage that i'm viewing instead of the Node i've selected in the MNTP.
Any work around for this that you might encounter?
Thanks a lot. Still kind of new on how the Hybrid Framework works :)
Hello,
In the Hybrid Framework there is an extension method you could try to use. You can use those by adding the Umbraco.Extensions.Utilities namespace.
This code might not work, but it gives an idea of how it could be done:
Than you have the node you've selected with MNTP in your child action.
Jeroen
Found a way, it seems like Html.Action bit doesn't like interface, i was trying to pass the IPublishedContent in previously
Thanks Jeroen
Hi Jeroen,
Quick question about Donut Caching, I've tested out the Donut Caching bits today not sure if you encountered similar things.
I've created a profiles in the web.config and during development i've set this to 0.
But when I turn the duration value now to like 900 (which is 15 mins).
The first time i load a page, everything seems to load fine, but when I refresh the page like pressing Ctrl + F5.
The page then loads without any styles (like just plain text). Have you encountered this before?
I'm using ClientDependency as well.
Hello,
Sorry I haven't encountered this before. How do you load the styles in the website?
Btw I've also released a version of the Hybrid Framework for Umbraco 7: http://our.umbraco.org/projects/developer-tools/hybrid-framework-for-umbraco-v7
Jeroen
I'm minifying the css and JS through Client dependency like
Html.RequiresCss("/Css/style.css", 1);
and then rendering it on the page as below, i'll see if i need to exclude that from the cache
@Html.RenderCssHere()
I haven't used Client dependency so it might be related to that. You could try Cruncher as an alternative. It works very easy. https://github.com/JimBobSquarePants/Cruncher
Jeroen
Thanks Jeroen, will try that out. Cruncher works with Donut Caching right? :)
Yes I've used it with the Hybrid Framework for v7: https://github.com/jbreuer/Hybrid-Framework-for-Umbraco-v7-Best-Practises/blob/master/Umbraco.Site/Views/Master.cshtml#L16-L22
Jeroen
Oh sweet. Thanks for the help :)
Are you using the built-in output caching, or are you using https://github.com/moonpyk/mvcdonutcaching ? I've had problems with the latter, as it doesn't seem to like complex models (though, maybe the new release has fixed that). One option for complex models would be to serialize them to a string (e.g., using the JSON serializer), and deserialize them in the controller action. Not sure if that's the issue you are having though.
is working on a reply...