CommandArgument for a LinkButton in a repeater (.net 1.1)

M

MattB

I'm trying to put a Link button in the ItemTemplate of a repeater. I've
created/wired the handler event, and I'm just trying to make the
LinkButton pass what I need to that event. I thought I had it right, but
I get a parser error when running this page. LinkButton looks like this:

<asp:LinkButton id="lbDel" runat="server" CommandName="delete"
CommandArgument='<%# DataBinder.Eval(Container.DataItem,
"id"%>')>Remove</asp:LinkButton>

I'm pretty sure there is a problem with the CommandArgument part but I
can't figure out what it is. I've been trying different uses of single
and double quotes thinking maybe that was it but it still hasn't started
working. Can anyone see what I did wrong there? Thanks!

Matt
 
A

adwb

I believe there is a syntax error. Try this instead:

<asp:LinkButton id="lbDel" runat="server" CommandName="delete"
CommandArgument='<%# DataBinder.Eval(Container.DataItem,"id")
%>'>Remove</asp:LinkButton>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,968
Messages
2,570,154
Members
46,702
Latest member
LukasConde

Latest Threads

Top