Solved

Using Button CommandArgument

Posted on 2008-10-01
3
604 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
Comment Utility
try this:

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

Assisted Solution

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

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

Expert Comment

by:CodeCruiser
Comment Utility
Is the LinkID field part of the datasource?
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

772 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