相关疑难解决方法(0)

Expression语句中的问题绑定字符串变量

我是<link>标签中的绑定路径

<link rel="stylesheet" media="screen" href='<%= AbsRoot_Path%>UserAccountTemp/css/reset.css' />
Run Code Online (Sandbox Code Playgroud)

但它像那样呈现......

<link rel="stylesheet" media="screen" href="&lt;%= ConfigurationManager.AppSettings[&quot;rootpath&quot;].ToString() %>UserAccountTemp/css/reset.css" />
Run Code Online (Sandbox Code Playgroud)

它正在运行<script>标签.

这背后的原因是什么,解决方案是什么?

UPDATE

设置AbsRoot_Path

在web.config中

<add key="rootpath" value="http://localhost:1259/WallProfile/"/>
Run Code Online (Sandbox Code Playgroud)

并设置为AbsRoot_Path

public string AbsRoot_Path = ConfigurationManager.AppSettings["rootpath"].ToString();
Run Code Online (Sandbox Code Playgroud)

asp.net server-tags

2
推荐指数
1
解决办法
2175
查看次数

标签 统计

asp.net ×1

server-tags ×1