Solved

ObjectDataSource caching data

Posted on 2008-10-21
4
459 Views
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"
                 OldValuesParameterFormatString="{0}"
                    SelectMethod="GetCustomerFacilityCSV"
                    TypeName="CustomerClass" >

How do i make the data source stop caching data when the page is reached through javascript:history(-1)?
0
Comment
Question by:troycomp
[X]
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
4 Comments
 
LVL 3

Expert Comment

by:trunghieubkit
ID: 22772926
Replacing
CacheDuration="0"
by
CacheDuration="60"

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

Expert Comment

by:trunghieubkit
ID: 22772933
More one,

replacing

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

by

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


0
 

Author Comment

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

Accepted Solution

by:
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?
0

Featured Post

Raise the IQ of Your IT Alerts

From IT major incidents to manufacturing line slowdowns, every business process generates insights that need to reach the people required to take action. You need a platform that integrates with your business tools to create fully enabled DevOps toolchains.

You need xMatters.

Question has a verified solution.

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

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

691 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