?
Solved

asp linkbutton commandargument value results in "The server tag is not well formed"

Posted on 2007-03-26
3
Medium Priority
?
1,774 Views
Last Modified: 2010-05-19
I have a repeater control which populates a table with asp:linkbuttons.

The asp:linkbuttons each have a different commandName, obviously, but their commandarguments will all be the same. I want their commandarguments to be populated by a data item from the repeater control called "SERVICE_ID".

The following code causes an error when compiled: "The server tag is not well formed"
<td class="intraContent" align="center" style="border-bottom: 2px solid #D3D3D3"><asp:LinkButton runat="Server" id="linkButton1" CssClass="lnkbutton" CommandName="Collection_All" CommandArgument="<%# eval("Service_ID") %>"><%#databinder.eval(container.dataitem,"Collection_Count") %></asp:LinkButton></td>

However, when I replace the commandargument with just a plain old string hard-coded in like "1234", it compiles without a problem.

So what is wrong with the syntax CommandArgument="<%# Eval("Service_ID") %>" ???

Thank you,
rss2
0
Comment
Question by:rss2
[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 15

Expert Comment

by:crisco96
ID: 18791989
Does

<%# databinder.eval(container.dataitem, "Service_ID") %>

fix it?
0
 
LVL 16

Accepted Solution

by:
Swapnil Piparia earned 2000 total points
ID: 18792000
Hi rss2,
  try changing

CommandArgument="<%# Eval("Service_ID") %>"

to

CommandArgument= '<%# Databinder.Eval(container.dataitem,"Service_ID") %>'

because service_id is databound item.

Regards,
NetSwap.
0
 

Author Comment

by:rss2
ID: 18792133
I tried both syntax methods but neither worked.

HOWEVER, it was surrounding it with double quotes which made it fail!

THANK YOU!!! I have used your commandargument above with single quotes as you have and it's working. :)
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

801 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