Note that there are some explanatory texts on larger screens.

plurals
  1. POOutput caching on PartialViews doesn't work
    primarykey
    data
    text
    <p>OutputCaching on the main controller actions seems to work fine but for PartialViews they don't seem to work as expected. </p> <p>I added the attribute in one of the partialviews, debugged it. I continuously hit the breakpoint inside the method (which i think means output caching isn't working). I tried providing parameters, cacheprofiles, enablingoutputcaching and fragments but same effect. Is there something else that I am missing?</p> <pre><code>[ValidateInput(false)] [OutputCache(Duration = 60000, VaryByParam = "componentId;")] public PartialViewResult NewCategoryComboPartial(string componentId) { //ComponentId ViewData[ControllerEnums.GlobalViewDataProperty.ComponentId.ToString()] = componentId; //ViewModel ViewData[ControllerEnums.GlobalViewDataProperty.ProfileComponentCategories.ToString()] = GetComponentCategoriesList(); return PartialView("~/Views/Compliance/Profile/Partials/NewCategoryCombo.ascx"); } </code></pre> <p>Is it because of an existing action filter? ValidateInputAttribute? My PartialView()? </p> <p>Thanks in advance.</p> <p><strong>UPDATE:</strong></p> <p>Below is the code snippet from the main view on how the partialview is declared.</p> <pre><code> &lt;div id="compliance-navigation-control"&gt; &lt;% Html.RenderPartial("~/Views/Shared/Compliance/ComplianceNavigationControl.ascx", Model.PandCRecord); %&gt; &lt;/div&gt; </code></pre> <p>Below is the content of the partialview</p> <pre><code>&lt;%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl&lt;dynamic&gt;" %&gt; &lt;%@ Import Namespace="atp.webnav.Web.Controllers" %&gt; &lt;%@ Import Namespace="atp.webnav.Web.Utilities" %&gt; &lt;% Html.DevExpress().ComboBox(x =&gt; { x.Name = "categoryComboBox_" + ViewData[ControllerEnums.GlobalViewDataProperty.ComponentId.ToString()].ToString(); x.Theme = "Glass"; x.Width = Unit.Percentage(100); x.Properties.ValueType = typeof(string); x.Properties.TextField = "Name"; x.Properties.ValueField = "Id"; x.SelectedIndex = 0; x.Properties.DropDownStyle = DropDownStyle.DropDown; x.Properties.MaxLength = 30; x.Properties.IncrementalFilteringMode = IncrementalFilteringMode.StartsWith; x.Properties.AllowUserInput = true; x.CallbackRouteValues = new {Controller = "Profile", Action = "NewCategoryComboPartial"}; x.Properties.EnableCallbackMode = true; x.Properties.CallbackPageSize = 1000; x.Properties.ClientSideEvents.BeginCallback = "webnav.compliance.profile.categoryComboBox_OnBeginCallback"; x.Properties.ClientSideEvents.SelectedIndexChanged = "webnav.compliance.profile.categoryComboBox_OnSelectedIndexChanged"; x.Properties.ClientSideEvents.EndCallback = "webnav.compliance.profile.categoryComboBox_OnSelectedIndexChanged"; x.Properties.ClientSideEvents.CallbackError = DevExpressGridViewHelper.HandleCallbackErrors; x.Properties.EnableSynchronizationOnPerformCallback = true; }) .BindList(ViewData[ControllerEnums.GlobalViewDataProperty.ProfileComponentCategories.ToString()]) .Render(); %&gt; </code></pre> <p>Essentially this combobox is a devexpress combobox that has autocomplete features. It uses callbacks to the controller actions to get the data based on the value selected. I am trying to see if I can cache the results of the callback. Thanks.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload