﻿<?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 - WebGrid Enterprise - SetCacheControl</title><link>http://www.intersoftsolutions.com/Community/WebGrid/SetCacheControl/</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>SetCacheControl</title><link>http://www.intersoftsolutions.com/Community/WebGrid/SetCacheControl/</link><pubDate>Thu, 27 May 2010 02:56:20 GMT</pubDate><dc:creator>Glayaar</dc:creator><description>&lt;p&gt;In my test using the latest build for WebGrid 7 and WebUI Framework 3, build 402 and build 752 respectively, I could successfully refresh 
the grid during flypostback. &lt;br /&gt;&lt;/p&gt;
&lt;p&gt;In my scenario, I use a 
WebButton in order to trigger a flypostback request and during the click
 event handler, I will need to invoke the RenderControl function to 
refresh the WebGrid and during FlyPostBackRequest the initialize data 
source logic will be executed. Here is the snippet:&lt;/p&gt;&lt;pre&gt;protected void WebButton1_Clicked(object sender, ISNet.WebUI.WebDesktop.WebButtonClickedEventArgs e)&lt;br /&gt;{&lt;br /&gt;    WebButton1.ClientAction.RenderControl(WebGrid1); &lt;br /&gt;}&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description></item><item><title>SetCacheControl</title><link>http://www.intersoftsolutions.com/Community/WebGrid/SetCacheControl/</link><pubDate>Wed, 26 May 2010 10:38:12 GMT</pubDate><dc:creator>bloveall</dc:creator><description>&lt;p&gt;Actually, I was wrong. The code above does not work even if accept the default caching. Why would this be? Like I said, it works fine in normal situations - just not in "FlyPostBacks" where the grid has lost its cache.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Brad&lt;/p&gt;</description></item><item><title>SetCacheControl</title><link>http://www.intersoftsolutions.com/Community/WebGrid/SetCacheControl/</link><pubDate>Wed, 26 May 2010 10:14:46 GMT</pubDate><dc:creator>bloveall</dc:creator><description>&lt;p&gt;Hi, &lt;/p&gt;
&lt;p&gt;I have a situation where I am trying to extend the cache from the default of five minutes to something more like 10 minutes and I'm not sure how to do this. The following code is taken from the InitializeDataSource event. This runs fine when I accept the normal WebGrid caching mechanism. It gets called after five minutes or so of inactivity and all is well. But when I try to extend it, by including the SetCacheControl() method, I get an error when this event is called during a FlyPostBack. The error is the familiar error where the grid just hangs and the circle in the lower left hand corner of the grid just goes round and round. I presume that it is related to the SetCacheControl call but am not certain. Is there a way to extend the cache timeout from five minutes to, say, ten minutes?&lt;/p&gt;&lt;pre&gt;If Me.FieldsPopulated OrElse _
            WebGrid1.IsFlyPostBackRequest Then
            Try
                Dim dt As DataTable = Me.DoSearch()
                e.DataSource = dt

                If dt.Rows.Count = 0 Then
                    Me.DoSearch_NoResults()
                Else
                    Me.DoSearch_Results(dt.Rows.Count)
                End If

                Me.ApplyFilters()


                WebGrid1.SetCacheControl(New TimeSpan(0, 10, 0), CacheItemPriority.Normal)
                Me.DataSourceInitialized = True
            Catch ex As Exception
                Throw ex
            End Try
        End If

&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Brad&lt;/p&gt;</description></item></channel></rss>