Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 3.5 > ASP.NET 3.5 Basics
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
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!
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 06:15 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.