MyObjectDataSource - update
I have been using MyObjectDataSource control for some time now with great success. I have however observed one thing that was missing. The missing thing was the possibility to use the container on which the control was placed as the actual TypeName object which provides the methods for Select, Insert, Update and Delete. Oh, of course it was possible before by using the TypeName and providing the name of the type that the page inherits from, but it had two major drawbacks:
- It required the page object to be instantiated 2 times: one for handling the request and the second time to provide an object on which the DataSource methods were called. (possible workaround was to use static methods, but then, no page state information was available)
- Providing a type name for a page is not so easy. It depends on few factors. By default the type name is the name of the code behind class with _aspx postfix. But it can be anything you choose by using the ClassName attribute of the Page directive in the aspx file.
So I have made some changes to the control and now if the TypeName property is not specified, the methods of the containing object are used. Further more, the same object is used as the one used to serve the request. Of course all the rest of the functionality remains unchanged. The source code and binary file is accessible here and here.
3 Comments:
Hello Michal,
greate work, I love your ods. I just was wondering what licence you are using for your code? Is someone free to use it or to continue developing it?
Best regeards
El Gringo
By Anonymous, at 12:53 PM
For now it may be a Let Me Know licence - i.e. let me know if you use my stuff and what do you think about it :-)
By Mikeon, at 9:10 AM
I have modified this code so now I can use
Bind("Company.Item.Name") style two way databinding. Drop me a mail if you are interested.
emperon@gmail.com
By Onur Gümüş, at 8:18 PM
Post a Comment
<< Home