This is a migrated thread and some comments may be shown as answers.

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

1 Answer 895 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
XiMnet Malaysia
Top achievements
Rank 1
XiMnet Malaysia asked on 03 Jun 2015, 03:21 AM

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.

 

1 Answer, 1 is accepted

Sort by
0
XiMnet Malaysia
Top achievements
Rank 1
answered on 03 Jun 2015, 06:06 AM

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""]")%>' />

Tags
ListBox
Asked by
XiMnet Malaysia
Top achievements
Rank 1
Answers by
XiMnet Malaysia
Top achievements
Rank 1
Share this question
or