"Parser Error Message: The server tag is not well formed" 在 ASP.NET

"Parser Error Message: The server tag is not well formed" in ASP.NET

我在第 17 行遇到错误。但我找不到它。 `

Line 15:  <asp:Repeater ID="ArticleRepetear" runat="server" DataSourceID="SqlDataSource1" OnItemCommand="ArticleRepetear_ItemCommand">
Line 16:  <ItemTemplate>
Line 17:  <asp:LinkButton ID="TitleLinkButton" runat="server" OnCommand="TitleLinkButton_Click" CommandArgument="<%#Eval("id").ToString() %>">
Line 18: <h1><%#Eval("title") %></h1>
Line 19: </asp:LinkButton>`

语法中缺少什么?

变化:CommandArgument='<%#Eval("id").ToString() %>'

<asp:LinkButton ID="TitleLinkButton" runat="server" 
OnCommand="TitleLinkButton_Click" CommandArgument="<%#Eval("id").ToString() %>">
 <h1><%#Eval("title") %></h1>
</asp:LinkButton>`

 <asp:LinkButton ID="TitleLinkButton" runat="server" 
        OnCommand="TitleLinkButton_Click" CommandArgument='<%# Eval("id").ToString() %>'>
<h1><%#Eval("title") %></h1></asp:LinkButton>`

错误是 CommandArgument 中的双引号:-

CommandArgument="<%#Eval("id").ToString() %>">

改为:-

CommandArgument='<%#Eval("id").ToString() %>'>