foreign key column data viewdata not cleared

2 posts, 0 answers
  1. Pantulu
    Pantulu  avatar
    10 posts
    Member since:
    Feb 2015

    Posted 16 Jun 2015 Link to this post

    I am using a foreign key column in my grid, and populate the data from viewdata as below


                  columns.ForeignKey(c => c.PersonId, (SelectList)ViewData["PersonSource"]);


    I set the  ViewData["PersonSource"] at the page load and the values are updated correctly.

    But in UI the column populates the values from the cache rather than the ViewData. It works fine if I manually clear the browser cache.

    Anyways I can overcome this issue? 

  2. Daniel
    Daniel avatar
    2231 posts

    Posted 18 Jun 2015 Link to this post


    Perhaps the page is being cached. Could you try using the OutputCache attribute on the action that returns the view with the grid:
    [OutputCache(NoStore = true, Duration = 0, VaryByParam = "*")]
    public ActionResult Index()

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top