I have a form view, in the edit template I have two drop downs. Drop down 1 is explicitly set with a list of allowed values. It is also set to autopostback. Drop down 2 is databound to an objectdatasource, this objectdatasource uses the first dropdown as one of it's parameters. (The idea is that drop down 1 limits what is shown in drop down 2)
On the first view of the edit template for an item it works fine. But if drop down 1 has a different item selected it post back and generates an error
Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control.
Here is the drop down list #2:
<asp:DropDownList ID="ProjectList" runat="server" SelectedValue='<%# Bind("ConnectToProject_ID","{0:D}") %>' DataSourceID="MasterProjectsDataSource2" DataTextField="Name" DataValueField="ID" AppendDataBoundItems="true">
<asp:ListItem Value="0" Text="{No Master Project}" Selected="True" />
</asp:DropDownList>
And here is the MasterProjectDataSource2:
<asp:ObjectDataSource ID="MasterProjectsDataSource2" runat="server"
SelectMethod="GetMasterProjectList" TypeName="WebWorxData.Project" >
<SelectParameters>
<asp:ControlParameter ControlID="RPMTypeList" Name="RPMType_ID"
PropertyName="SelectedValue" Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>
Any help on how to get this to work would be greatly appriciated.