|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
ObjectDataSourceHello,
I wish to use declarative datasources as much as possible. Using an ObjectDataSource makes sense in a few situations. I see that the TypeName is used to instantiate an object and methods are called, and parameter can be identified, and feed to the method. My question is, if i have an object already created as an httphander (ref would be httpcontext.Users say). Can the reference this object, say getallusers(), in using an ObjectDataSource? doug Problem you'll run into if you need an instance is that the ODS will create
an instance of whatever object you specify itself for every single call, so if you were to provide it with a handler as your typename, it will create a separate instance of the type and call *that* object's method rather than your handler's. The more efficient way to use ODS is to expose static methods of a class so that the ODS doesn't attempt to do a default construction of an instance of the specified object. So in answer to your question, I am pretty sure the answer it "no" if you need to instantiate the object yourself, unless there's some trick in there that I've missed (in my own case, I just used static methods because it fit into my app better)
looking for a special kind of table control
Control-level security Paging and Filtering in Gridview (.NET 2.0) Question on Submit all fields on a tabstrip that is using multipage Highlight row in a gridview after formview insert XML Editor The mystery of passing form values Refreash DesignTime control. How can I prevent a GridView from opening when the page is firstentered ? Little green arrows |
|||||||||||||||||||||||