Discussion:
Binding DropDownList II
Brady Kelly
2007-04-29 22:12:00 UTC
Permalink
OK, moving on, I use ItemDataBound to set the DataSource and DataValueField
and DataTextField properties on a DropDownList and suddenly my markup data
binding expression, "Text='<%# Eval("TSAdminuserID") %>'" doesn't work any
more. I get the following exception:



Databinding methods such as Eval(), XPath(), and Bind() can only be used in
the context of a databound control



WTF? Why is it not seen as bound any more?



My ItemDataBound binding code is as follows:



ddlTimeSheetType.DataSource =
this.MyController.TimesheetTypeList;

ddlTimeSheetType.DataValueField = "Value";

ddlTimeSheetType.DataTextField = "Text";

ddlTimeSheetType.DataBind();


===================================
This list is hosted by DevelopMentor� http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com
Loading...