Hello gurus,
I have a FormView bound to an ObjectDataSource.
* ObjectDataSource definition (omitted portion of it for simplicity)*
<asp:ObjectDataSource
ID="odsHousehold"
runat="server"
TypeName="BLL.Households"
ConflictDetection="OverwriteChanges"
UpdateMethod="UpdateHousehold"
>
<UpdateParameters>
<asp:Parameter Name="sName" Type="String" Direction="Input" />
<asp:Parameter Name="sAddress" Type="String" Direction="Input" DefaultValue="" />
<asp:Parameter Name="sCity" Type="String" Direction="Input" DefaultValue="" />
<asp:Parameter Name="sState" Type="String" Direction="Input" DefaultValue="" />
<asp:Parameter Name="sZip" Type="String" Direction="Input" DefaultValue="" />
</UpdateParameters>
</asp:ObjectDataSource>
* FormView definition (omitted portion of it for simplicity) *
<asp:FormView
ID="fvHousehold"
runat="server"
DataKeyNames="HouseholdID"
DataSourceID="odsHousehold"
HorizontalAlign = "Left"
>
<EditItemTemplate>
<asp:TextBox ID="txtHouseHoldName" runat="server" MaxLength="50" Width="100%" Text='<%# Bind("HouseholdName") %>'></asp:TextBox>
<asp:TextBox ID="txtAddress" runat="server" MaxLength="50" Width="100%" Text='<%# Bind("Address") %>'></asp:TextBox>
<asp:TextBox ID="txtCity" runat="server" MaxLength="50" Width="100%" Text='<%# Bind("City") %>'></asp:TextBox>
<asp:TextBox ID="txtState" runat="server" MaxLength="50" Width="100%" Text='<%# Bind("State") %>'></asp:TextBox>
<asp:TextBox ID="txtZip" runat="server" MaxLength="50" Width="100%" Text='<%# Bind("Zip") %>'></asp:TextBox>
<asp:Button ID="btnUpdateHousehold" runat="server" Text="Update" CommandName="Update" />
</EditItemTemplate>
</asp:FormView>
I'd like to know: how does the FormView know which UpdateParameter to populate with which EditTemplate TextBox when the Update button is clicked?
For instance, I haven't instructed "txtAddress" in the FormView to populate the UpdateParameter "sAddress" but InputParameters["sAddress"] contains the Text value of txtAddress. How does it know to do that?
Could any guru enlighten me?
Thank you so much,
Cullen