asp.net网站中如何高效的使用绝对路径

jason819 2012-09-17 03:44:33
我想在自己的网站中使用绝对路径,包括引用CSS文件,js文件,图片文件,还有CSS文件中的图片文件,不知道该如何做?
如:
<html xmlns="http://www.w3.org/1999/xhtml" >
<head><title>
</title>
<script type="text/javascript" src="http://www.csdn.net/Js/jquery-1.7.2.js"></script>
<link type="text/css" href="http://www.csdn.net/NhibernateWeb/css/index.css"/>
</head>
<body>
<form name="form1" method="post" action="DivTest.aspx" id="form1">
<div>
<img src="http://www.csdn.net/NhibernateWeb/Images/0002.jpg" width="200" height="200" />
</div>
</form>
</body>
</html>

css.index
body{
background:url(http://www.csdn.net/images/bg.gif);
}
...全文
113 5 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
晨晨 2013-05-20
  • 打赏
  • 举报
回复
在开发的时候用http://localhost来设置所有文件的地址,以后往哪发部前,用文件替换功能把里面所有的http://localhost用你想用的地址替换掉就行了。
KK3K2005 2013-05-20
  • 打赏
  • 举报
回复
引用 2 楼 jason819 的回复:
我想在本地程序用http://localhost,发布后使用如http://www.csdn.net
本地在架一个web服务 把 需要的资源放在里面 然后 host文件里 设置 http://www.csdn.net localhost
number1170196649 2013-05-19
  • 打赏
  • 举报
回复
怎么设置呢?
jason819 2012-09-17
  • 打赏
  • 举报
回复
我想在本地程序用http://localhost,发布后使用如http://www.csdn.net
潮之金龙 2012-09-17
  • 打赏
  • 举报
回复
域名不用写下去,全部路径用"/"斜杠号开头就行了

28,409

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧