G
Guest
Hi,
I have a reapeater control with linkbutton controls in the item template
section.
An array of USER objects will be the data source and I want to embed USER.id
as the CommandArgument so that when the user clicks the button, she is
redirected to a url which includes the id string.
The code below doesn't parse the expression between the <%# *> tags when it
is embedded in the tag's attribute, but it's fine when the block is between
an open and end tag.
Can any one give a clue as to what's going on and how I might retain the Id
value for later use when responding to the link button's click event?
Thank You,
Keith Harris
==================================================
CODE:
==================================================
<asp:Repeater ID="repeaterLinkedAccounts" Runat="server"
OnItemCreated="repeaterLinkedAccounts_ItemCreated"
OnItemCommand="repeaterLinkedAccounts_ItemCommand">
<ItemTemplate>
<ul>
<li>
<asp:LinkButton
ID="linkbuttonLinkedUser"
Runat="server"
CommandName="showprofile"
CommandArgument="<%#DataBinder.Eval(Container.DataItem,"Id")%>">
<%#DataBinder.Eval(Container.DataItem,"FullName")%>
</asp:LinkButton>
</li>
</ul>
</ItemTemplate>
</asp:Repeater>
I have a reapeater control with linkbutton controls in the item template
section.
An array of USER objects will be the data source and I want to embed USER.id
as the CommandArgument so that when the user clicks the button, she is
redirected to a url which includes the id string.
The code below doesn't parse the expression between the <%# *> tags when it
is embedded in the tag's attribute, but it's fine when the block is between
an open and end tag.
Can any one give a clue as to what's going on and how I might retain the Id
value for later use when responding to the link button's click event?
Thank You,
Keith Harris
==================================================
CODE:
==================================================
<asp:Repeater ID="repeaterLinkedAccounts" Runat="server"
OnItemCreated="repeaterLinkedAccounts_ItemCreated"
OnItemCommand="repeaterLinkedAccounts_ItemCommand">
<ItemTemplate>
<ul>
<li>
<asp:LinkButton
ID="linkbuttonLinkedUser"
Runat="server"
CommandName="showprofile"
CommandArgument="<%#DataBinder.Eval(Container.DataItem,"Id")%>">
<%#DataBinder.Eval(Container.DataItem,"FullName")%>
</asp:LinkButton>
</li>
</ul>
</ItemTemplate>
</asp:Repeater>