Hi Imar,
In my Golf Club Web App (which I am building as I read your book), I have a webform that will allow a club member to enter in his golf round score. I am trying to use the DetailsView datacontrol for the record insert. The table to be updated is called "Rounds". The main fields in the Rounds table are: 1) CourseID; 2) TeeID; 3)RoundDate; and 4) Score. In my DetailsView, I have converted CourseID and TeeID fields into templates so that I can replace the textbox's with DDLs.
Two of these fields relate to two "child" tables -- once called "Courses" and the other "Tees". The CourseID field relates to the Id field in the "Courses" table and the TeeID field relates to the Id field of the Tees table. For each course there may be many Tee records (Golf Course A with several possible Tee Boxes, i.e., Black, Blue, White, etc.).
The user will select the course played from DropDownList1 that uses a datasource with the Courses Id and Name fields (no problem with that...). The Courses table has an Id for each course that is related to a CourseID field in the Tees table.
I want DropDownList2 (datasource with Tees Id, CourseID and Name fields) to only display the Tees that have the CourseID equal to the course selected in DropDownList1.
So, DDL1 feeds a course name (value) to DDL2 datasource which should filter on this Id to display only the Tees applicable to this course. The VWD 2010 Express doesn't seem to do all this "behind the scenes". And when I think I've got it set up, I get this error:
Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control. .
I've seen this scenario described in other web postings with rather complicated potential solutions. Do you have an approach / reference you could steer me towards? I'm still a beginner -- so still struggling on some of this stuff. Thanks.
