I'm using asp.net 2.0. I am using declarative datasources. For some things in the code behind I want access to the object returned by Foo.Bar (In the following example). the system is caching it so I should be able to acces that version instead of having to re-call Foo.Bar(). How do I do this?
<asp:ObjectDataSource ID="MyLuckDataSource1" runat="server"
TypeName="Foo.Bar" SelectMethod="GetMoreFoo"
CacheDuration="Infinite" CacheExpirationPolicy="Sliding"
EnableCaching="True">
<SelectParameters>
<asp:ControlParameter ControlID="BarID" Name="bar_code" Type="String" Direction="Input" DefaultValue="1011" />
</SelectParameters>
</asp:ObjectDataSource>
<asp:GridView ID="GridView1" runat="server" runat="server" DataSourceID="MyLuckDataSource1" ...