【发布时间】:2011-04-09 05:25:45
【问题描述】:
我在标签中绑定路径
<link rel="stylesheet" media="screen" href='<%= AbsRoot_Path%>UserAccountTemp/css/reset.css' />
但它会这样渲染......
<link rel="stylesheet" media="screen" href="<%= ConfigurationManager.AppSettings["rootpath"].ToString() %>UserAccountTemp/css/reset.css" />
它正在工作
这是什么原因,解决办法是什么?
更新
设置 AbsRoot_Path
在 web.config 中
<add key="rootpath" value="http://localhost:1259/WallProfile/"/>
并设置为 AbsRoot_Path
public string AbsRoot_Path = ConfigurationManager.AppSettings["rootpath"].ToString();
【问题讨论】:
-
设置 AbsRoot_Path 的代码不正确。
-
显示设置 AbsRoot_Path 的代码。我敢打赌它有一些错位的引号。
-
我在我的问题中编写代码...见第一行。
-
不,你没有。设置变量 AbsRoot_Path 的代码在哪里。您只显示使用变量的代码而不是为其分配值的代码。
-
哦……对不起!现在再次查看问题我更新了...
标签: asp.net server-tags