服务器标签格式不正确

时间:2013-08-27 09:43:44

标签: c# html5

这里是我的HTML:

<asp:Label ID="EmployeeIDlbl" runat="server" Text="<%# GetLabelCaption("Judges", "Employee Number",CaptionType.EditLabel) %>"></asp:Label>

其中:CaptionStyle是我之前创建的EnumeratorGetLabelCaption函数返回从sql数据库获取的字符串。

我想知道错误在哪里?!!

2 个答案:

答案 0 :(得分:2)

将单引号放在提及文字的位置,如下所示:

<asp:Label ID="EmployeeIDlbl" runat="server" Text='<%# GetLabelCaption("Judges", "Employee Number",CaptionType.EditLabel) %>'></asp:Label>

这将有效

答案 1 :(得分:2)

您需要将文字内容放在单引号(' ')中,而不是双引号(" ")。所以试试这个

<asp:Label ID="EmployeeIDlbl" runat="server" Text='<%# GetLabelCaption("Judges", "Employee Number",CaptionType.EditLabel) %>'></asp:Label>
相关问题