Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Using Button CommandArgument

Posted on 2008-10-01
3
Medium Priority
?
636 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 1000 total points
ID: 22621995
try this:

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

Assisted Solution

by:Richard Lee
Richard Lee earned 1000 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

927 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