Solved

Using Button CommandArgument

Posted on 2008-10-01
3
619 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

Is Your DevOps Pipeline Leaking?

Is your CI/CD pipeline a hodge-podge of randomly connected tools? You’ve likely got a tool to fix one problem & then a different tool to fix another, resulting in a cluster of tools with overlapping functionality. Learn how to optimize your pipeline with Gartner's recommendations

Question has a verified solution.

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

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

751 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