Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error specifying DataFields in a DataList

Status
Not open for further replies.

qwert231

Programmer
Sep 4, 2001
756
US
Here is my code:
Code:
78 objReader = objComm.ExecuteReader()
79 subjList.DataSource = objReader
80 subjList.DataTextField = "SubjectID"
81 subjList.DataValueField = Trim("Path")
82 subjList.DataBind()

Quite simply, I want to specify that the text shown is from the SubjectID field, and the Data Value is from the Path field (trimmed).

I get these errors in Visual Studio:
(80): 'DataTextField' is not a member of 'System.Web.UI.WebControls.DataList'.
(81): 'DataValueField' is not a member of 'System.Web.UI.WebControls.DataList'.


This is newly migrated from inline code (<script> block) to codebehind, and I have some other questions, but it didn't quite fit under the other posts I had started.
 
A datalist doesn't have the DataTextField or DataValueField attributes.

D
 
No, but a Listbox does... hehe, sorry. Silly me... i Forgot what it was I was trying to work with.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top