在我的代码中,我有一个中继器,在它的数据源中,我有一个属性 FirstName。当我尝试从中获取数据时,出现此错误:
The server tag is not well formed.
有问题的代码是:
<asp:Label ID="lblOName" runat="server" Text="<%# Eval("FirstName") %>"></asp:Label>
我错过了什么?
最佳答案
没关系,我修好了它。我只需要将引号替换为:
<asp:Label ID="lblOName" runat="server" Text='<%# Eval("FirstName") %>'></asp:Label>
关于asp.net - 将数据放入标签时服务器标签格式不正确,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18695271/