ObjectDataSource SelectMethod and SelectCountMethod

When using the control ObjectDataSourcefor SelectMethodand SelectCountMethod, instance methods or static methods can be used. According to the MSDN documentation , if an instance method is used, a new instance will be created and deleted after completion.

If it is an instance method, a business object is created and each time it destroys the method specified by the SelectMethod property is called.

However, according to this depth the passage , if paging is enabled, and both methods SelectMethodand SelectCountMethodare instances, the same instance is used when calling these methods.

If we enabled paging and our SelectMethod and SelectCountMethod are instance methods, the same instance is used when both methods are called , so we can store the total number of registers in a field in SelectMethod, and then we can return it to SelectCountMethod.

In another link , the information provided (apparently by a member of the MS ASP.NET team) contradicts the above information.

However, you must understand that different instances of the Select and SelectCount methods are used to call ...

My question is . Which of these behaviors is real implemented in asp.net? Is the same instance used when invoking these methods or is it called by different instances?

( .net 3.5 VS 2008) ( , ), . / SelectMethod, SelectCountMethod. , , SelectMethod SelectCountMethod - . , - , ( 06), , (.net 4.0 ).

, , , , .

+3

All Articles