Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 3.5 > ASP.NET 3.5 Basics
|
ASP.NET 3.5 Basics If you are new to ASP or ASP.NET programming with version 3.5, this is the forum to begin asking questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 22nd, 2009, 10:10 PM
Authorized User
 
Join Date: Jan 2009
Posts: 25
Thanks: 3
Thanked 1 Time in 1 Post
Default 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"/>
&nbsp;<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!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Name "Eval" is not declared. thuyvncr BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 3 December 21st, 2006 03:48 AM
eval - and other resource hogs crmpicco Javascript 0 September 27th, 2005 06:30 AM
Eval??? tsimsha Classic ASP Basics 2 January 17th, 2005 10:02 PM
Databinder.Eval jpfree71 ASP.NET 1.0 and 1.1 Basics 2 August 26th, 2004 11:07 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.