ObjectDataSource caching data

Posted on 2008-10-21
Last Modified: 2013-12-17
I have a search page with a gridview populated with an objectdatasource. When a link in the gridview is clicked it navigates to the update page. Once the update page is open, i have a cancel button which takes the user to the previous page, javascript:history(-1). If data on the update page is saved to the database and the cancel button is pressed and the search page is open. When you click search the new data in the database doesnt appear, but if you select the search page from the menu or hit f5 then do a search the data appears. The object data source is caching the data and i have it turned off:

<asp:ObjectDataSource EnableCaching="false" CacheDuration="0" CacheExpirationPolicy="Sliding" ID="dataSource" runat="server"
                    TypeName="CustomerClass" >

How do i make the data source stop caching data when the page is reached through javascript:history(-1)?
Question by:troycomp
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2

Expert Comment

ID: 22772926

it means 60 seconds
or what number you want, it is time that cache is alive,

Expert Comment

ID: 22772933
More one,


<asp:ObjectDataSource EnableCaching="false" CacheDuration="0" CacheExpirationPolicy="Sliding"


<asp:ObjectDataSource EnableCaching="true" CacheDuration="60"


Author Comment

ID: 22772937
Isnt setting CacheDuration="0" telling it to keep the cache alive for 0 seconds? And EnableCaching="false" so im confused

Accepted Solution

troycomp earned 0 total points
ID: 22773606
Also if the user right clicks on the page and then clicks "Back" i get the same results. Why isnt the object datasource hitting the database?

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question