加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

asp.net – <%=不想在css元素中打印出来

发布时间:2020-12-16 09:49:18 所属栏目:asp.Net 来源:网络整理
导读:当使用链接元素时,asp不会处理%= CssVersion%但将其解释为文字字符串 link href="../../css/style01.css?%= CssVersion %" rel="stylesheet" type="text/css" 以上的输出是 link type="text/css" rel="stylesheet" href="../../css/style01.css?%= CssVers
当使用链接元素时,asp不会处理<%= CssVersion%>但将其解释为文字字符串

<link href="../../css/style01.css?<%= CssVersion %>" rel="stylesheet" type="text/css">

以上的输出是

<link type="text/css" rel="stylesheet" href="../../css/style01.css?<%= CssVersion >">

但是当使用它时

<script language="javascript" src="../../js/tiutil_1.0.js?<%= CssVersion %>" type="text/javascript"></script>

然后打印出正确的

<script type="text/javascript" src="../../js/tiutil_1.0.js?220409" language="javascript"></script>

知道为什么吗?

谢谢

解决方法

我不是为什么这样做,但我找到了另一种解决方案

<link <%="href='../../css/style01.css?" + CssVersion + "'"%> rel="stylesheet" type="text/css" />

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读