aspx页面,前台页面需要用到后台变量字段的时候我们一般使用  <%= 变量  %>,多数情况下使用正常。

但是有的时候就会遇到变量解析被编码的情况,特别是是在head当中css引用link当中的href中使用时:

<link href="<%=Path %>css/style.css" rel="stylesheet" />

但是在js引用src路径中使用正常:

<script src="<%=Path %>Scripts/jquery-1.8.2.min.js"></script>

解决方法:

<link href="<%= "" + Path %>css/style.css" rel="stylesheet" />

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-10-01
  • 2022-01-22
  • 2021-11-04
  • 2022-12-23
  • 2021-06-21
  • 2021-05-29
猜你喜欢
  • 2023-01-10
  • 2021-09-22
  • 2022-12-23
  • 2022-02-12
  • 2023-01-10
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案