All,
I have a basic aspx page with a GridView and ObjectDataSource. I have EnableCaching set to true. A user can check a check box in the first column of the GridView, set a status code and update all of the changed records with a button click. After that "update" I want to refresh the dataset. This doesn't seem to be happening. I'm wondering if anyone out there has experience with caching data and then forcing the ObjectDataSource to go back to the Select Method to get new data and not to the cache.
Here's a snippet of what I have (taken from articles that I have found on the web:
ASPX:
And the VB page:
Any help would be great
Thanks
-- Joe --
Journeyman -- The Order of the Seekers of Truth and Penitence
I have a basic aspx page with a GridView and ObjectDataSource. I have EnableCaching set to true. A user can check a check box in the first column of the GridView, set a status code and update all of the changed records with a button click. After that "update" I want to refresh the dataset. This doesn't seem to be happening. I'm wondering if anyone out there has experience with caching data and then forcing the ObjectDataSource to go back to the Select Method to get new data and not to the cache.
Here's a snippet of what I have (taken from articles that I have found on the web:
ASPX:
Code:
<asp:ObjectDataSource ID="odsProfile" TypeName="GridViewHelper" SelectMethod="GetWorkListData"
runat="server" CacheDuration="0" CacheExpirationPolicy="Absolute" EnableCaching="True">
<SelectParameters>
< ... Paramaters .../>
</SelectParameters>
</asp:ObjectDataSource>
<asp:GridView ID="gvWorkList" runat="server" AutoGenerateColumns="false" AllowSorting="true" ShowHeader="true" Enabled="true" GridLines="Both" UseAccessibleHeader="true" EnableViewState="false" DataSourceID="odsProfile" AllowPaging="true">
< ... FORMATTING ... />
</asp:GridView>
And the VB page:
Code:
Private Sub Page_Load...
If IsNothing(Cache(odsProfile.CacheKeyDependency)) Then
Cache(odsProfile.CacheKeyDependency) = New Object()
End If
End Sub
'* ** Save Button Event, I want to force the ObjectDataSourceto go back to the Select Method and get new data ** *
Protected Sub wibSave_Click...
'* ** Exec SQL to Update Checked Rows.
For Each gv As GridViewRow In gvWorkList.Rows
... Do Something ...
Next
'* ** Force Refresh. Does not seem to do anything.
Cache(odsProfile.CacheKeyDependency) = New Object()
End Sub
Any help would be great
Thanks
-- Joe --
Journeyman -- The Order of the Seekers of Truth and Penitence