This is a migrated thread and some comments may be shown as answers.

[Solved] combobox in partial view outputcache problem

0 Answers 19 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jim
Top achievements
Rank 1
Jim asked on 05 Apr 2012, 06:29 PM
(I accidentally posted this first in "general". Sorry)

I have a partial view that defines a combobox item:

 
@(Html.Telerik().ComboBox()
                    .Name("ddlClientView")
                    .BindTo(@Model.ClientList)
                    .HtmlAttributes(new { @class = "smallerSelect rounded", style="height:18px;" })
                )

where @Model.ClientList is a SelectList

In the Action method where I create the partial view I have output caching specified:

   
     [OutputCache(Duration=3000)]
        [ChildActionOnly]
        public ActionResult ClientList()
        {
            return PartialView("ClientView", new ClientListViewModel());
        }

this action is called from a layout file:

     
       <div id="clientView">
                @Html.Action("ClientList", "Util")
            </div>



Problem: the combobox renders correctly the first time, including the first time after the cache duration expires. But if the view is created from the cache the telerik combox is empty.

I searched and didn't see any other comments about this.
Tags
ComboBox
Asked by
Jim
Top achievements
Rank 1
Share this question
or