I have a dropdownlist that gets data through entity objects, but with a navigation. But I get an error trying to do this, can anyone help me please. <asp:DropDownList ID="ddlVacancy" DataValueField="ID" DataTextField='<%# Eval("Position.Name") %>'
runat="server" Width="200px"/>
views:
114answers:
1
A:
You can create a property in your entity object like this:
public string PositionName
{
get
{
return Position.Name;
}
}
and then replace Eval("Position.Name") with Eval("PositionName")
hope this helps
Matin Habibi
2010-05-19 10:44:21