I have a form view, in the editing template I have two descents. Drop-down list 1 explicitly sets a list of valid values. It is also set to autorun. Drop 2 is a data binding to a data source object, this source object uses the first drop-down menu as one of its parameters. (The idea is that falling down 1 limits what is shown in drop-down list 2)
In the first view of the editing template for an element, it works fine. But if drop 1 has another element selected after it and generates an error
Data binding methods such as Eval (), XPath (), and Bind () can only be used in the context of database management.
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 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 make this work would be greatly appreciated.
source share