Solved

Using Button CommandArgument

Posted on 2008-10-01
3
611 Views
Last Modified: 2013-11-08
Hello I have the following imagebutton in a repeater:

                  <asp:ImageButton ID="ScheduleButton" runat="server" ImageUrl="../Images/Webmasters/MyLinks/Schedule_Button.gif" CssClass="ScheduleButton" OnCommand="ScheduleButton_Command" CommandName="LinkID" CommandArgument="1"/>

When I attempt to Change the commandargument to a databound value i get an error:

Parser Error Message: Type 'System.Web.UI.WebControls.ImageButton' does not have a public property named 'ImageButton'.

Here is what I need:
<asp:ImageButton ID="ScheduleButton" runat="server" ImageUrl="../Images/Webmasters/MyLinks/Schedule_Button.gif" CssClass="ScheduleButton" OnCommand="ScheduleButton_Command" CommandName="LinkID" CommandArgument="<%#Eval("LinkID")%>"/>

Thanks
0
Comment
Question by:grogo21
3 Comments
 
LVL 7

Accepted Solution

by:
ajolly earned 250 total points
ID: 22621995
try this:

CommandArgument="<%#Eval('LinkID')%>"/>
0
 
LVL 18

Assisted Solution

by:Richard Lee
Richard Lee earned 250 total points
ID: 22622616
Try placing single quote around the entire EVAL statement

CommandArgument='<%#Eval("LinkID")%>'
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 22623951
Is the LinkID field part of the datasource?
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

816 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now