我是<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="<%= ConfigurationManager.AppSettings["rootpath"].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)