PC Review


Reply
Thread Tools Rate Thread

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

 
 
MattB
Guest
Posts: n/a
 
      24th Jan 2008
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
 
Reply With Quote
 
 
 
 
adwb@community.nospam
Guest
Posts: n/a
 
      25th Jan 2008
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>


On Jan 24, 2:53*pm, MattB <somedud...@yahoo.com> wrote:
> 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


 
Reply With Quote
 
Jignesh
Guest
Posts: n/a
 
      25th Jan 2008
Closing brackets of Eval function is missing

Regards
JIGNESH

"MattB" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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


 
Reply With Quote
 
MattB
Guest
Posts: n/a
 
      25th Jan 2008
Ah! Thanks. It's always the simplest problems that are the hardest to see.

Matt

(E-Mail Removed)am wrote:
> 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>
>
>
> On Jan 24, 2:53 pm, MattB <somedud...@yahoo.com> wrote:
>> 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

>

 
Reply With Quote
 
MattB
Guest
Posts: n/a
 
      25th Jan 2008
Thank you!

Matt

Jignesh wrote:
> Closing brackets of Eval function is missing
>
> Regards
> JIGNESH
>
> "MattB" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> 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

>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Asp repeater & LinkButton Peter Kirk Microsoft C# .NET 2 7th Nov 2005 08:12 AM
C# linkbutton question object does not contain a definition for CommandArgument needin4mation@gmail.com Microsoft ASP .NET 2 13th Oct 2005 02:06 AM
commandargument in linkbutton Question Patrick Olurotimi Ige Microsoft ASP .NET 0 20th Jun 2005 09:08 AM
LinkButton CommandArgument bound property loses value on postback =?Utf-8?B?QmVuamFtaW4gSm9sZGVyc21h?= Microsoft ASP .NET 2 21st Aug 2004 06:57 PM
Repeater / LinkButton =?Utf-8?B?RGFu?= Microsoft ASP .NET 2 27th Mar 2004 06:21 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:02 PM.