﻿<?xml version="1.0" encoding="utf-8"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Intersoft Community - ISDataSource - How to clear ISDataSource Cache on client side</title><link>http://www.intersoftsolutions.com/Community/ISDataSource/How-to-clear-ISDataSource-Cache-on-client-side/</link><description /><generator>http://www.intersoftsolutions.com</generator><language>en</language><copyright>Copyright 2002 - 2015 Intersoft Solutions Corp. All rights reserved.</copyright><ttl>60</ttl><item><title>How to clear ISDataSource Cache on client side</title><link>http://www.intersoftsolutions.com/Community/ISDataSource/How-to-clear-ISDataSource-Cache-on-client-side/</link><pubDate>Mon, 30 Nov 2009 01:22:40 GMT</pubDate><dc:creator>yudi</dc:creator><category>How to clear ISDataSource Cache on client side</category><description>&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;There is a workaround to achieve your scenario.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;First, you need to have a flag that tells whether ISDataSource cache needs to be cleared or not. Since you need to have ISDataSource cache to be cleared when the year list selection is changed, the flag can be set in _fiscalYearList_onchange client side event.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;After set the flag, it has to be sent to server side (before refresh WebGrid) where we can clear the ISDataSource cache based on this parameter. It can be send by using “AddInput” method of WebGrid.&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;&amp;lt;script language="javascript" type="text/javascript"&amp;gt;
    &amp;lt;!--
    function _fiscalYearList_onchange() {
        var wg = ISGetObject('_webGrid');
        var ClearCachedData = "1";

        wg.AddInput("NeedClearCachedData", ClearCachedData);
        wg.Refresh();
    }
    --&amp;gt;
&amp;lt;/script&amp;gt;&lt;/pre&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;Later, on Page_Load event we can retrieve the parameter and clear ISDataSource cache where the condition is met.&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;protected void Page_Load(object sender, EventArgs e)
{
    if (!Page.IsPostBack)
    {
        _fiscalYearList.Items.Add("2009");
        _fiscalYearList.Items.Add("2008");

        _fiscalYearList.Attributes["onchange"] = "return _fiscalYearList_onchange()";            
    }

    string NeedClearCachedData = string.IsNullOrEmpty(Request.Form["NeedClearCachedData"]) ? "" : Request.Form["NeedClearCachedData"];
        
    if (NeedClearCachedData == "1")
        ISDataSource1.Tables[0].ClearCache();
}&lt;/pre&gt;</description></item><item><title>How to clear ISDataSource Cache on client side</title><link>http://www.intersoftsolutions.com/Community/ISDataSource/How-to-clear-ISDataSource-Cache-on-client-side/</link><pubDate>Wed, 25 Nov 2009 10:55:09 GMT</pubDate><dc:creator>yuting</dc:creator><category>How to clear ISDataSource Cache on client side</category><description>&lt;p&gt;I use "EnableCaching", so when I do Sort or Filter on the Grid, Select Method retrieve the data from the cache rather than from business object that associated with it. &lt;/p&gt;
&lt;p&gt;But I when I change the Year selection from the dropdown list, I want the refreshed data from the business object (from database). Because the data may be changed. That's why I want to clear the ISDataSource cache when the year list selection is changed.&lt;/p&gt;
&lt;p&gt;If I don't use ISDataSource for the data binding, with AllowAutoDataCaching property on grid set to True, webgrid.Refresh() will make &lt;span style="font-size: 13px"&gt;_webGrid_InitializeDataSource called again where&amp;nbsp;retrieve the data from business&amp;nbsp;object.&amp;nbsp;Can the ISDataSource behave the same way?&lt;/span&gt;&lt;/p&gt;</description></item><item><title>How to clear ISDataSource Cache on client side</title><link>http://www.intersoftsolutions.com/Community/ISDataSource/How-to-clear-ISDataSource-Cache-on-client-side/</link><pubDate>Tue, 24 Nov 2009 22:17:02 GMT</pubDate><dc:creator>yudi</dc:creator><category>How to clear ISDataSource Cache on client side</category><description>&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;I’ve been able to run your sent sample on my end. I’m sorry for the inconvenience if I didn’t understand your issue very well.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;When you enable caching on ISDataSource, GetLeaseActivity function only gets called at first time. In order to have the GetLeaseActivity function called on the second time and so on, you can simply set EnableCaching property of ISDataSource to “no” value.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;Should you have any specific reasons that you should use “EnableCaching” and clear ISDataSource caching at the same time, please let us know.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>How to clear ISDataSource Cache on client side</title><link>http://www.intersoftsolutions.com/Community/ISDataSource/How-to-clear-ISDataSource-Cache-on-client-side/</link><pubDate>Tue, 24 Nov 2009 09:14:50 GMT</pubDate><dc:creator>yuting</dc:creator><category>How to clear ISDataSource Cache on client side</category><description>&lt;p&gt;No, this does not help. It's doing the same thing. Besides I don't want to clear the session-state collection. Is there a way to just clear the ISDataSource Caching on client side or server side? My orginal attachement is a working sample, you can test the TestCachingForm to see if it works or not. &lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;</description></item><item><title>How to clear ISDataSource Cache on client side</title><link>http://www.intersoftsolutions.com/Community/ISDataSource/How-to-clear-ISDataSource-Cache-on-client-side/</link><pubDate>Mon, 23 Nov 2009 22:29:24 GMT</pubDate><dc:creator>yudi</dc:creator><category>How to clear ISDataSource Cache on client side</category><description>&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;Please try to clear the session in OnInitializeLayout of WebGrid event, as shown below.&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;protected void _webGrid_InitializeLayout(object sender, ISNet.WebUI.WebGrid.LayoutEventArgs e)
{
    HttpContext.Current.Session.Clear();
}&lt;/pre&gt;

&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;Please let me know whether this helps or not.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>How to clear ISDataSource Cache on client side</title><link>http://www.intersoftsolutions.com/Community/ISDataSource/How-to-clear-ISDataSource-Cache-on-client-side/</link><pubDate>Mon, 23 Nov 2009 16:02:04 GMT</pubDate><dc:creator>yuting</dc:creator><category>How to clear ISDataSource Cache on client side</category><description>&lt;p&gt;Maybe I didn't explain the problem clear enough. I have a ISDataSource which is using CustomObject. Its SelectMethod is set to "GetLeaseActivity" which is in TestIntersoft.UI.DataLayer. You have to set a Breakpoint inside function GetLeaseActivity and debug to it. GetLeaseActivity will only get called once for the same year. For example, I selected 2009 and then 2008, and then 2009 again. GetLeaseActivity function only get called at first time I selected 2009 or 2008, not on the seconde time I select 2009.&lt;/p&gt;
&lt;p&gt;On your sample, there is no way I can check if the SelectMothed got called on the second time.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</description></item><item><title>How to clear ISDataSource Cache on client side</title><link>http://www.intersoftsolutions.com/Community/ISDataSource/How-to-clear-ISDataSource-Cache-on-client-side/</link><pubDate>Sun, 22 Nov 2009 23:31:06 GMT</pubDate><dc:creator>yudi</dc:creator><category>How to clear ISDataSource Cache on client side</category><description>&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;I modify your sample to use dsNorthwind dataset that available in WebGridSamples project and tried to reproduce the issue based on your sent sample, but I was unable to replicate the issue on my end.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;Please have the attached sample tested on your end and let me know your response.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>How to clear ISDataSource Cache on client side</title><link>http://www.intersoftsolutions.com/Community/ISDataSource/How-to-clear-ISDataSource-Cache-on-client-side/</link><pubDate>Fri, 20 Nov 2009 15:45:45 GMT</pubDate><dc:creator>yuting</dc:creator><category>How to clear ISDataSource Cache on client side</category><description>&lt;p&gt;My webgrid is bound to the ISDataSource. I set EnableCaching to Yes on the ISDataSource. I have a dropdown list. I want to refresh the webgrid with the new data when the list selection is changed on a Flypostback. I call the wg.Refresh() in my srcript. But the webgrid is filled with the cached data. It doesn't call the SelectMethod in ISDataSource. Is there a way to clear ISDataSource cache on the client side?&lt;/p&gt;
&lt;p&gt;The attached is a working sample. Please check TestCachingForm.&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;</description></item></channel></rss>