简体   繁体   English

服务器标签格式不正确

[英]Server tag not well formed

I am trying to use Web.Router and I am trying to set it in a hyperlink where some variables need to be binded from a dataTable. 我正在尝试使用Web.Router,并且试图在需要从dataTable绑定某些变量的超链接中设置它。 Also, this link is a part of a Gridview:- 另外,此链接是Gridview的一部分:-

    <a href='<asp:Literal runat="server" Text="<%# String.Format("$RouteUrl:id={0},title={1}", Eval("ID"), Eval("title") %>" />' target="_blank" style="color:#330000; font-size:18px; font-weight:bold"><%# Eval("title")) %></a>

But I get error: Server Tag not well formed. 但是我收到错误消息:服务器标记格式不正确。 What's wrong with the syntax? 语法有什么问题?

Try changing 尝试改变

<a href='<asp:Literal runat="server" Text="<%# String.Format("$RouteUrl:id={0},title={1}", Eval("ID"), Eval("title") %>" />' target="_blank" style="color:#330000; font-size:18px; font-weight:bold"><%# Eval("title")) %></a>

To this 对此

<a href='<asp:Literal runat="server" Text='<%# String.Format("$RouteUrl:id={0},title={1}", Eval("ID"), Eval("title") %>" />' target="_blank" style="color:#330000; font-size:18px; font-weight:bold"><%# Eval("title")) %></a>

You put a double quot instead of single quot 您将双引号而不是单引号

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM