C# checkbox和itemtemplate上的服务器标记格式不正确
我收到错误“服务器标记格式不正确。” 在我的代码的这一部分的复选框上C# checkbox和itemtemplate上的服务器标记格式不正确,c#,asp.net,data-binding,C#,Asp.net,Data Binding,我收到错误“服务器标记格式不正确。” 在我的代码的这一部分的复选框上 <ItemTemplate> <table style="table-layout:fixed;" border="0" width="100%" cellpadding="0" cellspacing="0"> <td class="ListItem" style="padding-left:0px"> <asp:CheckBox ID="chkbo
<ItemTemplate>
<table style="table-layout:fixed;" border="0" width="100%" cellpadding="0" cellspacing="0">
<td class="ListItem" style="padding-left:0px">
<asp:CheckBox ID="chkbox" runat="server" Checked='<%# DataBinder.Eval(Container,"Attributes['checked']") %>' ></asp:CheckBox>
</td>
</table>
</ItemTemplate>
我猜这是由于报价中包含单引号的双引号。。。我尝试了很多方法,比如用双引号替换数组中的单引号,甚至尝试通过索引访问属性,保护引号。。。没有成功
我见过很多关于这个错误的帖子,但是没有一个有用。
有什么问题吗?看看
改变
Checked='<%# DataBinder.Eval(Container,"Attributes['checked']") %>'
Checked=''
到
Checked=''
Checked='<%# DataBinder.Eval(Container,"YourBoolPropName") %>'