Stack Exchange
How to instruct ObjectDataSource to match form parameter with method parameter
When working with ObjectDataSource I have following select:
<asp:DropDownList runat="server" SelectedValue='<%# Bind("InceptionCycle.ID") %>' ID="InceptionCycle" 
     DataSourceID="odsAllCycles" DataTextField="CycleName" DataValueField="ID" AppendDataBoundItems="true">
     <asp:ListItem Text="Choose..." Value=""></asp:ListItem>
</asp:DropDownList>

and ObjectDataSource configured with UpdateMethod and InsertMethod. However insert/update methods have parameters with InceptionCycle name (because InceptionCycle.ID is not valid identifier).
Is there a way to instruct ObjectDataSource to take InceptionCycle.ID form parameter and place in as InceptionCycle method parameter?
Here's full ObjectDataSource code:
<asp:ObjectDataSource ID="ods" runat="server" TypeName="Sources.DomainSource"
    SelectMethod="FindById" InsertMethod="Add" UpdateMethod="Update"
    OnInserted="ods_Inserted" OnUpdated="ods_Updated">
    <SelectParameters>
        <asp:QueryStringParameter Name="id" QueryStringField="id" />
    </SelectParameters>
    <InsertParameters>
        <asp:Parameter ConvertEmptyStringToNull="true" Name="ShortTitle" />
        <asp:Parameter ConvertEmptyStringToNull="true" Name="WMRId" />
        <asp:Parameter ConvertEmptyStringToNull="true" Name="MDSId" />
        <asp:Parameter ConvertEmptyStringToNull="true" Name="Status" />
    </InsertParameters>
    <UpdateParameters>
        <asp:QueryStringParameter Name="id" QueryStringField="id" />
        <asp:Parameter ConvertEmptyStringToNull="true" Name="ShortTitle" />
        <asp:Parameter ConvertEmptyStringToNull="true" Name="WMRId" />
        <asp:Parameter ConvertEmptyStringToNull="true" Name="MDSId" />
        <asp:Parameter ConvertEmptyStringToNull="true" Name="Status" />
    </UpdateParameters>
</asp:ObjectDataSource>


It seems you'd need to specify control parameters on that ObjectDataSource. Please paste your ObjectDataSource definition.

Oh, and my Add/Update methods do not take object as parameter but simple types (int/string)

You can only use the Bind syntax with a top level property - it doesn't support nested properties (VS 2012 will, though).
So, you should create a new property on your data source like below and bind the SelectedValue to this new property instead
 public string InceptionCycleID
 {
      get
      {
           return InceptionCycle.ID;
      }
      set
      {
           InceptionCycle.ID = value;
      }
 }


Actually, binding value to select control, it's not the issue and it wasn't stated in question. What is more, my SelectedValue is binded correctly when form loads.
