我有以下行:
<link href="<%= Links.Content.Site_css %>" rel="stylesheet" type="text/css" />
呈现为
<link href="Views/Shared/%3C%25=%20Links.Content.Site_css%20%25%3E" rel="stylesheet" type="text/css" />
所以不执行表达式。如果我删除引号:
<link href=<%= Links.Content.Site_css %> rel="stylesheet" type="text/css" />
表达式被执行,但标记变得 xhtml 不兼容。解决此问题的正确方法是什么?