P
Phillip Ian
I've got the following:
<asp:ObjectDataSource ID="lu" runat="server" TypeName="cFactory"
SelectMethod="GetLookup" UpdateMethod="UpdateLookup"
DataObjectTypeName="cLookupItem">
<SelectParameters>
<asp:QueryStringParameter Name="which" QueryStringField="lookup"
/>
</SelectParameters>
<UpdateParameters>
<asp:QueryStringParameter Name="which" QueryStringField="lookup"
/>
</UpdateParameters>
</asp:ObjectDataSource>
<asp:GridView ID="GridView1" runat="server" DataSourceID="lu"
AutoGenerateColumns="False">
<Columns>
<asp:BoundField DataField="Name" />
<asp:CommandField ShowEditButton="True" />
</Columns>
</asp:GridView>
Rather simple little one-column editable gridview.
My problem is with the update parameters. If I specify
DataObjectTypeName, the UpdateParameters section of the
ObjectDataSource seems to be ignored: "ObjectDataSource 'lu' could not
find a non-generic method 'UpdateLookup' that takes parameters of type
'cLookupItem'."
Is that normal? I'd like to pass my object plus selected other
parameters to the update method. If I omit the DataObjectTypeName, I
correctly get "ObjectDataSource 'lu' could not find a non-generic
method 'UpdateLookup' that has parameters: which, Name."
Obviously, I could write the update method to take which and Name as
parameters, but there are other cases which use other properties of the
cLookupItem object. I'd hate to have to make different update methods
for each.
limiting.
<asp:ObjectDataSource ID="lu" runat="server" TypeName="cFactory"
SelectMethod="GetLookup" UpdateMethod="UpdateLookup"
DataObjectTypeName="cLookupItem">
<SelectParameters>
<asp:QueryStringParameter Name="which" QueryStringField="lookup"
/>
</SelectParameters>
<UpdateParameters>
<asp:QueryStringParameter Name="which" QueryStringField="lookup"
/>
</UpdateParameters>
</asp:ObjectDataSource>
<asp:GridView ID="GridView1" runat="server" DataSourceID="lu"
AutoGenerateColumns="False">
<Columns>
<asp:BoundField DataField="Name" />
<asp:CommandField ShowEditButton="True" />
</Columns>
</asp:GridView>
Rather simple little one-column editable gridview.
My problem is with the update parameters. If I specify
DataObjectTypeName, the UpdateParameters section of the
ObjectDataSource seems to be ignored: "ObjectDataSource 'lu' could not
find a non-generic method 'UpdateLookup' that takes parameters of type
'cLookupItem'."
Is that normal? I'd like to pass my object plus selected other
parameters to the update method. If I omit the DataObjectTypeName, I
correctly get "ObjectDataSource 'lu' could not find a non-generic
method 'UpdateLookup' that has parameters: which, Name."
Obviously, I could write the update method to take which and Name as
parameters, but there are other cases which use other properties of the
cLookupItem object. I'd hate to have to make different update methods
for each.
<updateparameters> but NOT both. Can someone verify that? Seems a bitFrom what I can tell, it is EITHER DataObjectTypeName OR
limiting.