1
votes

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 ObjectDataSource fires Update but does not fire insert.

1

1 Answers

0
votes

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!