Quotes in Command Argument binding expression

Discussion in 'ASP .Net Datagrid Control' started by Harlan Messinger, Aug 29, 2006.

  1. 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
    quotes causing a parsing error?
    Harlan Messinger, Aug 29, 2006
    #1
    1. Advertising

  2. Use

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

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


    "Harlan Messinger" <> wrote in message
    news:...
    > 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 quotes
    > causing a parsing error?
    Eliyahu Goldin, Aug 29, 2006
    #2
    1. Advertising

  3. Eliyahu Goldin wrote:
    > Use
    >
    > CommandArgument='<%# DataBinder.Eval(Container.DataItem, "OrderID") %>'
    >


    Well, that was simple enough. Thanks!
    Harlan Messinger, Aug 30, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Chris White

    Quotes/Double Quotes in Image Control

    Chris White, Sep 22, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    4,845
    Hermit Dave
    Sep 22, 2004
  2. Chris
    Replies:
    1
    Views:
    13,638
    Oisin
    Mar 24, 2006
  3. Lawrence Tierney

    Multiline quotes - escaping quotes - et al

    Lawrence Tierney, Dec 24, 2003, in forum: Java
    Replies:
    3
    Views:
    4,490
    Andrew Thompson
    Dec 24, 2003
  4. jOhn
    Replies:
    1
    Views:
    224
    Phlip
    Jan 29, 2008
  5. Richard Sandoval
    Replies:
    5
    Views:
    203
    7stud --
    Apr 26, 2011
Loading...

Share This Page