Solved

Using Button CommandArgument

Posted on 2008-10-01
3
624 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Cloud Training Guides

FREE GUIDES: In-depth and hand-crafted Linux, AWS, OpenStack, DevOps, Azure, and Cloud training guides created by Linux Academy instructors and the community.

Question has a verified solution.

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

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

632 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