我有以下行:ASP.NET MVC表达呈现 “原样”
<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不兼容。什么是解决这个问题的正确方法?