惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Security Affairs
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Jina AI
Jina AI
P
Palo Alto Networks Blog
GbyAI
GbyAI
大猫的无限游戏
大猫的无限游戏
A
Arctic Wolf
Hugging Face - Blog
Hugging Face - Blog
小众软件
小众软件
Y
Y Combinator Blog
T
The Blog of Author Tim Ferriss
Blog — PlanetScale
Blog — PlanetScale
S
Schneier on Security
V
Vulnerabilities – Threatpost
C
Cybersecurity and Infrastructure Security Agency CISA
雷峰网
雷峰网
T
Tenable Blog
人人都是产品经理
人人都是产品经理
T
Tor Project blog
C
Cyber Attacks, Cyber Crime and Cyber Security
AWS News Blog
AWS News Blog
Microsoft Security Blog
Microsoft Security Blog
J
Java Code Geeks
Scott Helme
Scott Helme
SecWiki News
SecWiki News
C
CERT Recently Published Vulnerability Notes
Recorded Future
Recorded Future
I
InfoQ
Security Archives - TechRepublic
Security Archives - TechRepublic
Help Net Security
Help Net Security
Cloudbric
Cloudbric
C
Check Point Blog
Engineering at Meta
Engineering at Meta
TaoSecurity Blog
TaoSecurity Blog
B
Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园_首页
N
News and Events Feed by Topic
云风的 BLOG
云风的 BLOG
MyScale Blog
MyScale Blog
腾讯CDC
量子位
Application and Cybersecurity Blog
Application and Cybersecurity Blog
K
Kaspersky official blog
Vercel News
Vercel News
F
Full Disclosure
T
Troy Hunt's Blog
Forbes - Security
Forbes - Security
S
Security @ Cisco Blogs

博客园 - 齐世昌

.resources文件转.resx 文件 同一Session中的aspx页面的并发限制 Diving Into Lync Client Logins Passing JavaScript Objects to Managed Code UI抑制限制(UI Suppression Limitations) JSON对象末尾多余逗号问题 T430 Windows 8 的USB3.0无法识别 【翻译】数据库上的IO已冻结,不需要任何用户操作 【翻译】为Web Forms添加捆绑(Bundling)和压缩(Minification) 禁用笔记本WiFi热点网络连接问题 推荐一个在线压缩JavaScript和CSS的网站 Windows 8不支持Windows XP 模式 又是一年(2012年) 本地测试网址推荐 text-overflow: ellipsis 在IE8、9下显示问题 Windows Server 2012 不支持SharePoint Server 2010(KB2724471) VirtualPathUtility.IsAppRelative的bug? 受信任站点在Windows 7 和Windows XP的注册表中的不同 contenteditable属性浏览器支持情况(基本支持)-工作草稿
神奇的img
齐世昌 · 2012-07-30 · via 博客园 - 齐世昌

各位童鞋想必对母版页中图片的路径纠结过吧。

美工切图一般都是html,页面中用到都是html标签,图片展示用到的就是img标签了。如果要做母版页,就要考虑纠结的路径问题。img的路径如果是相对母版页的,那和母版页同级目录下的内容页木有问题,子级目录下的内容页图就会破了。

如果站点不会部署到虚拟目录(IIS6)或者非顶级应用程序(IIS7.x),path可以写成’/’开头,从根路径算起。这种路径叫做网站根路径。

解决办法1: 换成服务器端控件asp:Image,路径中使用相对应用程序路径(~)。

解决办法2: 为img添加runat='server'属性,路径中使用对象应用程序路径(~)。 一定要加runat属性

相比较而言,方法2比方法1来,对原有代码修改量要少一些。

ASP.NET 网站路径