aspx <%= %> 綁定變量問題及解決方法

aspx頁面,前臺頁面須要用到後臺變量字段的時候咱們通常使用  <%= 變量  %>,多數狀況下使用正常。css

可是有的時候就會遇到變量解析被編碼的狀況,特別是是在head當中css引用link當中的href中使用時:jquery

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

可是在js引用src路徑中使用正常:編碼

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

解決方法:spa

<link href="<%= "" + Path %>css/style.css" rel="stylesheet" />
相關文章
相關標籤/搜索