UpdateParameters always set to 0
<p>I have a problem in my updating Event on the DetailsView control. It always sets the field parentID to 0 when passing a value from a dropdownlist to the UpdateParameters collection. I know that it finds the control in the event but i can't even set a default value to "1" in my example so its to do with the UpdateParameters property can tell me what Im doing wrong and how to fix it please</p>

<pre><code>protected void DetailsView1_ItemUpdating(object sender, DetailsViewUpdateEventArgs e)
{
    DropDownList forumGroup = DetailsView1.FindControl("DropDownList2") as DropDownList;
    string value = forumGroup.SelectedValue.ToString();
    ObjectDataSource3.UpdateParameters["parentID"].DefaultValue = "1" // always is 0;
}


    public int UpdateForumByID(int forumID, string title, string url, string description, 
        string imageUrl, int parentID, int importance, bool moderated, bool active)
    {
        ObjectContext context = new ObjectContext("name=CMSEntities");
        ObjectSet&lt;CMSModel.Forums&gt; forums = context.CreateObjectSet&lt;CMSModel.Forums&gt;();
        // here forum is null
        CMSModel.Forums forum = forums.FirstOrDefault(x =&gt; x.ForumID == forumID);
        forum.Title = title;
        forum.Url = url;
        forum.Description = description;
        forum.ImageUrl = imageUrl;
        forum.ParentID = parentID;
        forum.Importance = importance;
        forum.Moderated = moderated;
        forum.Active = active;

        int affectedRows = context.SaveChanges();

        return affectedRows;
    }
</code></pre>

<p>markup:`</p>

<pre><code>        &lt;asp:ObjectDataSource ID="ObjectDataSource3" runat="server" 
            SelectMethod="GetForumByID" TypeName="CMS.Framework.Forums" 
            UpdateMethod="UpdateForumByID"&gt;
            &lt;SelectParameters&gt;
                &lt;asp:ControlParameter ControlID="GridView1" Name="forumID" 
                    PropertyName="SelectedValue" Type="Int32" /&gt;
            &lt;/SelectParameters&gt;
            &lt;UpdateParameters&gt;
                &lt;asp:Parameter Name="forumID" Type="Int32"  /&gt;
                &lt;asp:Parameter Name="title" Type="String" /&gt;
                &lt;asp:Parameter Name="url" Type="String" /&gt;
                &lt;asp:Parameter Name="description" Type="String" /&gt;
                &lt;asp:Parameter Name="imageUrl" Type="String" /&gt;
                &lt;asp:Parameter Name="parentID" Type="Int32" /&gt;
                &lt;asp:Parameter Name="parentID" Type="Int32" /&gt;
                &lt;asp:Parameter Name="importance" Type="Int32" /&gt;
                &lt;asp:Parameter Name="active" Type="Boolean" /&gt;
            &lt;/UpdateParameters&gt;
        &lt;/asp:ObjectDataSource&gt;


        &lt;asp:DetailsView ID="DetailsView1" runat="server" 
            AutoGenerateRows="False" 
            DataKeyNames="ForumID" 
            DataSourceID="ObjectDataSource3"
            DefaultMode="Insert" 
            OnDataBound="DetailsView1_DataBound"
            OnItemCommand="DetailsView1_ItemCommand"
            OnItemUpdated="DetailsView1_ItemUpdated"&gt;
            &lt;Fields&gt;
                &lt;asp:BoundField DataField="ForumID" HeaderText="ForumID" 
                    SortExpression="ForumID" ReadOnly="true" InsertVisible="false" /&gt;
                &lt;asp:BoundField DataField="AddedBy" HeaderText="AddedBy" 
                    SortExpression="AddedBy" ReadOnly="true" InsertVisible="false" /&gt;
                &lt;asp:BoundField DataField="AddedDate" HeaderText="AddedDate" 
                    SortExpression="AddedDate" ReadOnly="true" InsertVisible="false" /&gt;
                &lt;asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" /&gt;
                &lt;asp:BoundField DataField="Url" HeaderText="Url" SortExpression="Url" /&gt;
                &lt;asp:BoundField DataField="Description" HeaderText="Description" 
                    SortExpression="Description" /&gt;
                &lt;asp:BoundField DataField="ImageUrl" HeaderText="ImageUrl" 
                    SortExpression="ImageUrl" /&gt;
                &lt;asp:TemplateField HeaderText="Forum Group:" InsertVisible="true" SortExpression="ForumGroup"&gt;
                    &lt;InsertItemTemplate&gt;
                        &lt;asp:DropDownList ID="DropDownList2" runat="server" 
                            DataSourceID="ObjectDataSource4" DataTextField="Key" DataValueField="Value"&gt;
                        &lt;/asp:DropDownList&gt;
                        &lt;asp:ObjectDataSource ID="ObjectDataSource4" runat="server" 
                            SelectMethod="GetDisplayForumGroups" TypeName="CMS.Framework.Forums"&gt;
                        &lt;/asp:ObjectDataSource&gt;
                    &lt;/InsertItemTemplate&gt;
                    &lt;EditItemTemplate&gt;
                        &lt;asp:DropDownList ID="DropDownList2" runat="server" 
                            DataSourceID="ObjectDataSource5" DataTextField="Key" DataValueField="Value"&gt;
                        &lt;/asp:DropDownList&gt;
                        &lt;asp:ObjectDataSource ID="ObjectDataSource5" runat="server" 
                            SelectMethod="GetDisplayForumGroups" TypeName="CMS.Framework.Forums"&gt;
                        &lt;/asp:ObjectDataSource&gt;
                    &lt;/EditItemTemplate&gt;
                &lt;/asp:TemplateField&gt;
                &lt;asp:BoundField DataField="Importance" HeaderText="Importance" 
                    SortExpression="Importance" /&gt;
                &lt;asp:CheckBoxField DataField="Moderated" HeaderText="Moderated" 
                    SortExpression="Moderated" /&gt;
                &lt;asp:CheckBoxField DataField="Active" HeaderText="Active" 
                    SortExpression="Active" /&gt;
                &lt;asp:BoundField DataField="UpdatedBy" HeaderText="UpdatedBy" 
                    SortExpression="UpdatedBy" ReadOnly="true" InsertVisible="false" /&gt;
                &lt;asp:BoundField DataField="UpdatedDate" HeaderText="UpdatedDate" 
                    SortExpression="UpdatedDate" ReadOnly="true" InsertVisible="true" /&gt;
                &lt;asp:TemplateField&gt;
                    &lt;InsertItemTemplate&gt;
                        &lt;asp:LinkButton ID="lnkInsert" runat="server" CommandName="Insert" Text="Insert"&gt;&lt;/asp:LinkButton&gt;
                        &lt;asp:LinkButton ID="lnkCancel" runat="server" CommandName="Cancel" Text="Cancel"&gt;&lt;/asp:LinkButton&gt;
                    &lt;/InsertItemTemplate&gt;
                    &lt;EditItemTemplate&gt;
                        &lt;asp:LinkButton ID="lnkUpdate" runat="server" CommandName="Update" Text="Update"&gt;&lt;/asp:LinkButton&gt;
                        &lt;asp:LinkButton ID="lnkCancel" runat="server" CommandName="Cancel" Text="Cancel"&gt;&lt;/asp:LinkButton&gt;
                    &lt;/EditItemTemplate&gt;
                &lt;/asp:TemplateField&gt;
            &lt;/Fields&gt;
        &lt;/asp:DetailsView&gt;
</code></pre>
