Databinding methods such as Eval(), XPath(), and Bind() can only be used in the conte
I have seen several threads on this issue and can not seem to get any of it to work for me. I have two drop downs on a form that cascade down for data entry. Basically they are a 'Long Term Goal', and then a 'Short Term Goal' based on the first drop down. I keep getting this error every time I try to bind the data to the SQL file.
I have tried turning the 'EnableView State' on and off with no luck.
Here are my dropdown codes:
<InsertItemTemplate>
<asp:DropDownListID="DropDownList2"runat="server"AutoPostBack="True"DataSourceID="LT"DataTextField="LTGoal"DataValueField="LTGoalID"EnableViewState="False">
</asp:DropDownList>
<asp:SqlDataSourceID="LT"runat="server"ConnectionString="<%$ ConnectionStrings:anthemprodConnectionString %>"SelectCommand="SELECT [LTGoalID], [LTGoal] FROM [TblGoalsLT]">
</asp:SqlDataSource>
STGoal:
<asp:SqlDataSourceID="ST"runat="server"ConnectionString="<%$ ConnectionStrings:anthemprodConnectionString %>"SelectCommand="SELECT SpecTargetID, SpecificTarget, MeasureID FROM TblGoalsST WHERE (MeasureID = @SpecTargetID)">
<SelectParameters>
<asp:ControlParameterControlID="DropDownList2"Name="SpecTargetID"PropertyName="SelectedValue"Type="Int32"/>
</SelectParameters>
</asp:SqlDataSource>
<asp:DropDownListID="DropDownList1"runat="server"DataSourceID="ST"DataTextField="SpecificTarget"DataValueField="SpecTargetID">
</asp:DropDownList>
<br/>
<asp:LinkButtonID="InsertButton"runat="server"CausesValidation="True"CommandName="Insert"Text="Insert"/>
<asp:LinkButtonID="InsertCancelButton"runat="server"CausesValidation="False"CommandName="Cancel"Text="Cancel"/>
</InsertItemTemplate>
Is there some C# code bihind I am not understanding, or is there something in the dropdown setup that I am missing?
Any help would be GREATLY appreicated!
|