mattgcon
mattgcon

Reputation: 4858

Proper syntax for container.dataitem binding to A Href tag

I have a Datagrid with an ItemTemplate in it to convert a dataitem to a link. However, when I run the app it errors out with:

FolderID is neither a DataColumn nor a DataRelation for table Table.

Here is the line of code in question:

  <b><a href="PerformanceEvaluationSubcontractorRating.aspx?ProjectID='<%#Container.DataItem("ProjectID")%>'&FolderID='<%#Container.DataItem("FolderID")%>'&SubcontractorID='<%#Container.DataItem("OrganizationID")%>'>
  <%#Container.DataItem("OrganizationName")%>
  </a></b>

What is wrong with the A Href tag?

Upvotes: 0

Views: 560

Answers (2)

Adam Tuliper
Adam Tuliper

Reputation: 30152

Ensure your field is part of your table (ie part of your query to populate the table)

Upvotes: 1

scartag
scartag

Reputation: 17680

The FolderID column is not present at the datasource. This error has nothing to do with the A Href tag, it is a databinding error. check the schema to retrieve the right column name.

Upvotes: 1

Related Questions