ASP.net objectDataSource
Is it possible to keep the same Method name for both insert and update in ObjectDatasource?
I am using Save() method for insert and update.But O开发者_Python百科bjectDataSource fires Update but does not fire insert.
Yes, this is possible. If you set the InsertMethod and UpdateMethod to the same routines, this should work fine.
<asp:ObjectDataSource ID="CustomerInfoDataSource" runat="server" DataObjectTypeName="Entities.CustomerInfo"
InsertMethod="Save" SelectMethod="GetByCustomerId" TypeName="Business.CustomerManager"
UpdateMethod="Save">
Hope this helps!
精彩评论