Server tag is not well formed with trying to bind to a textbox

2 posts, 0 answers
  1. XiMnet Malaysia
    XiMnet Malaysia avatar
    46 posts
    Member since:
    Jan 2006

    Posted 02 Jun 2015 Link to this post

    Hi,

    I try to bind an attribute to a ASP.NET Textbox in a ListBox.

    However I get the error ​"Server tag is not well formed"

    <asp:TextBox runat="server" Text="<%# DataBinder.Eval(Container, "Attributes['page_template_name']")%>" />

    When I try to follow the way in this older thread: http://www.telerik.com/forums/server-tag-is-not-well-formed-with-trying-to-assign-am-attribute-to-a-text-field, by escaping the quotes, I still get the same error.

    What is the correct way to bind the attribute?

    Thanks.

     

  2. XiMnet Malaysia
    XiMnet Malaysia avatar
    46 posts
    Member since:
    Jan 2006

    Posted 03 Jun 2015 Link to this post

    Hi,

     I have solved the issue. Instead of escaping with \" we need to escape with "".
    <asp:TextBox runat="server" Text='<%# DataBinder.Eval(Container, "Attributes[""page_template_name""]")%>' />

  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top