Groups | Blog | Home
all groups > asp.net datagrid control > august 2006 >

asp.net datagrid control : Quotes in Command Argument binding expression


Harlan Messinger
8/29/2006 8:39:03 AM
In VS2003, inside of a template column, I put a LinkButton with the
following attribute:

CommandArgument="<%# DataBinder.Eval(Container.DataItem, "OrderID") %>"

ASP.NET produced the following error message in the browser:

Parser Error Message: The server tag is not well formed.

If I put a public variable in my page:

public string Hello = "OrderID";

and change the attribute to:

CommandArgument="<%# DataBinder.Eval(Container.DataItem, Hello) %>"

then all is well.

What are the details of ASPX processing that result in these double
Eliyahu Goldin
8/29/2006 4:44:15 PM

Use

CommandArgument='<%# DataBinder.Eval(Container.DataItem, "OrderID") %>'

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]


[quoted text, click to view]

Harlan Messinger
8/29/2006 7:53:45 PM
[quoted text, click to view]

AddThis Social Bookmark Button