The "OutputCacheAttribute for child actions only supports Duration, VaryByCustom, and VaryByParam values..." error occurs
So I just watched the video tutorial of Umbraco particularly the surface controller part. And I learned that for server side controls like textbox (forms), we have to create partial view as *.cshtml and the created surface controller with HttpGet annotation will return that partial view.
error occurs saying that 'The "OutputCacheAttribute for child actions only supports Duration, VaryByCustom, and VaryByParam values...'
Reason for adding that annotation is to handle browser back button (reference link). Problem in my Umbraco powered mvc website is that when I click Log Out link, surface controller will clear the session and redirect to homepage. And from the homepage which has the login form (userame textbox, password & submit button as partial view), when the browser back button is pressed, browser displays the secured page/the previously entered page while he/she is logged in.
Hi David, I checked the link you provided and read that full page caching (which is what I need in my scenario) is already supported since MVC 1 (see quote below).
What I did to resolve my problem is to disable the cache all throughout the pages by adding custom Global.asax.cs (by default, it is inherited to Umbraco.Web.UmbracoApplication). Inside my Global.asax.cs: -- Oops, tried to add here my code but the preview shows a 1-liner code, making my code difficult to read.
Impact of this is that when the browser back button is being pressed, it triggers server side/my controllers and I can then handle thoroughly the flow especially the login session of the user.
WHAT IS DONUT CACHING?
When we talk about output caching, there are three different scenarios that we may encounter:
FULL PAGE CACHING
Full page caching is where you cache the entire page with no substitutions. It is handled with the built-in OutputCache attribute that has been available since ASP.NET MVC 1.
The "OutputCacheAttribute for child actions only supports Duration, VaryByCustom, and VaryByParam values..." error occurs
So I just watched the video tutorial of Umbraco particularly the surface controller part. And I learned that for server side controls like textbox (forms), we have to create partial view as *.cshtml and the created surface controller with HttpGet annotation will return that partial view.
However, when I try to add another annotation:
[OutputCache(NoStore - true, Duration = 0, VaryByParam = "None")]
error occurs saying that 'The "OutputCacheAttribute for child actions only supports Duration, VaryByCustom, and VaryByParam values...'
Reason for adding that annotation is to handle browser back button (reference link). Problem in my Umbraco powered mvc website is that when I click Log Out link, surface controller will clear the session and redirect to homepage. And from the homepage which has the login form (userame textbox, password & submit button as partial view), when the browser back button is pressed, browser displays the secured page/the previously entered page while he/she is logged in.
Not sure I fully understand, but checkout Donut caching. That probably provides more options for you. http://www.devtrends.co.uk/blog/donut-output-caching-in-asp.net-mvc-3
Hi David, I checked the link you provided and read that full page caching (which is what I need in my scenario) is already supported since MVC 1 (see quote below).
What I did to resolve my problem is to disable the cache all throughout the pages by adding custom Global.asax.cs (by default, it is inherited to Umbraco.Web.UmbracoApplication). Inside my Global.asax.cs: -- Oops, tried to add here my code but the preview shows a 1-liner code, making my code difficult to read.
Impact of this is that when the browser back button is being pressed, it triggers server side/my controllers and I can then handle thoroughly the flow especially the login session of the user.
When we talk about output caching, there are three different scenarios that we may encounter:
FULL PAGE CACHING
Full page caching is where you cache the entire page with no substitutions. It is handled with the built-in OutputCache attribute that has been available since ASP.NET MVC 1.
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.