o3h
asked on
Filling listview (ASP.net)
Hi inside a <ItemTemplate> of a Listview I try to do this:
<asp:Label ID="RolesLabel" runat="server" Text='<%# GetRoles(Eval('Id')) %>' />
In code-behind I have a function:
public string GetRoles(string id);
GetRoles looks up a bunch of roles and returns a string with rolenames. Byt I cant get this to work.
The error lies here:
GetRoles(Eval('Id')) , wrong syntax?
<asp:Label ID="RolesLabel" runat="server" Text='<%# GetRoles(Eval('Id')) %>' />
In code-behind I have a function:
public string GetRoles(string id);
GetRoles looks up a bunch of roles and returns a string with rolenames. Byt I cant get this to work.
The error lies here:
GetRoles(Eval('Id')) , wrong syntax?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Correct the quotes and use Eval("id").ToString()
<asp:Label ID="RolesLabel" runat="server" Text='<%# GetRoles(Eval("Id").ToStri