iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Hi,
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?
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
Thanks,
Brad
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.
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:
protected void WebButton1_Clicked(object sender, ISNet.WebUI.WebDesktop.WebButtonClickedEventArgs e){ WebButton1.ClientAction.RenderControl(WebGrid1); }
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.
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname