Enabling the ObjectDataSource_Selected event for cached data

  • Thread starter Thread starter msch-prv
  • Start date Start date
M

msch-prv

I have an objectDataSource that populates a datalist. When fresh data
is pulled out from the db, the SelectEvent event fires and updates the
datalist custom navigation links. When data is retrieved from the
cache however, this event becomes disabled. From what I have read, it
seems that for caching the ObjectDataSource Selected event is disabled
by design.

Is there a work-around, so as to re-enable this event and update the
navigation links? Thanks for any hints.
 
To clarifiy the issue, I should perhaps mention that the cached data
is carried out via HttpContext.Current.Cache in the BLL. Caching is
disabled at the ods level. I tried also to disable the object's view
state w/o success. Do I need to raise the event?


<asp:ObjectDataSource ID="odsRecipeDet" runat="server"
SelectMethod="GetRecipePageByRecipeCatID"
TypeName="Anders.BLL.Recipes.RecipesBLL"
EnableCaching="False"
OnSelected="odsRecipeDet_Selected" EnableViewState="True">
<SelectParameters>
<asp:QueryStringParameter Name="RecipeCatID"
QueryStringField="catid" DefaultValue="0" Type="Int32" />
<asp:QueryStringParameter Name="PageIndex"
QueryStringField="page" DefaultValue="0" Type="Int32" />
<asp:Parameter Name="NumRows" DefaultValue="4" Type="Int32" />
<asp:Parameter Name="RecipeCount" Direction="InputOutput"
Type="Int32" DefaultValue="0" />
</SelectParameters>
</asp:ObjectDataSource>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top