Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 30th, 2007, 05:33 PM
Registered User
 
Join Date: Jul 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default Are ObjectDataSource events disabled for caching?

I have a datalist tied to an ObjectDataSource that retrieves data out of a custom function located in my BLL. This function retrieves data from the db and supports caching. When the cached data is loaded back into the ods, the ods Selected event does not trigger anymore (fires ok for "fresh data").

From what I have read, it seems that ods events are disabled for cached data. Is this true? If so, is there a work-around? The ods Selected event is used to update the datalist navigation links. Thanks for any pointers.

 
Old October 31st, 2007, 07:52 AM
Registered User
 
Join Date: Oct 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

When we use catching with grid view or data list which is bound to objectdatasource, and select method is in business logic then it not fired for next upload event of page and data in grid is not refreshed.

You are right that ods select method is not called when we use catching.. then wt next

Possible option is disable catching and go for regular way of calling bind method of gridview or datalist control which will invoke select method.

Or try cache depedency if you konw about it.








 
Old October 31st, 2007, 08:58 AM
Registered User
 
Join Date: Jul 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks, but this would precisely defeat the purpose of caching the data if a new db access is made! I just want to update the navigation links whenever a page is retrieved from the cache.

For "fresh" data, the ods triggers the Select event; in case of caching, it stops firing up. I tried datalist binding to no avail. I guess an option would be to raise the ods Selected event. Some sample code on doing this is hard to find though.






Similar Threads
Thread Thread Starter Forum Replies Last Post
ObjectDataSource in UserControl Colonel Angus .NET Framework 2.0 0 April 3rd, 2008 10:14 AM
Problem with ObjectDataSource miguel.ossa ASP.NET 2.0 Professional 1 February 9th, 2008 08:37 AM
ObjectDataSource Best Practices? TKelley4591 BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 0 July 20th, 2007 02:39 PM
CH5 ObjectDataSource nabeelalkaff BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 0 March 8th, 2007 01:19 PM
What does ObjectDataSource.Update do? Aaron Edwards ASP.NET 2.0 Basics 1 November 27th, 2006 05:40 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.