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

推荐订阅源

博客园 - Franky
N
Netflix TechBlog - Medium
Google Online Security Blog
Google Online Security Blog
月光博客
月光博客
量子位
酷 壳 – CoolShell
酷 壳 – CoolShell
V
V2EX
腾讯CDC
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 聂微东
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
M
MIT News - Artificial intelligence
Vercel News
Vercel News
The GitHub Blog
The GitHub Blog
Hugging Face - Blog
Hugging Face - Blog
博客园 - 【当耐特】
Apple Machine Learning Research
Apple Machine Learning Research
aimingoo的专栏
aimingoo的专栏
博客园 - 三生石上(FineUI控件)
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
MongoDB | Blog
MongoDB | Blog
H
Help Net Security
The Cloudflare Blog
Blog — PlanetScale
Blog — PlanetScale
F
Full Disclosure
G
Google Developers Blog
罗磊的独立博客
Jina AI
Jina AI
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Y
Y Combinator Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
J
Java Code Geeks
A
About on SuperTechFans
IT之家
IT之家
大猫的无限游戏
大猫的无限游戏
S
SegmentFault 最新的问题
有赞技术团队
有赞技术团队
GbyAI
GbyAI
雷峰网
雷峰网
T
The Blog of Author Tim Ferriss
The Register - Security
The Register - Security
U
Unit 42
D
Docker
Martin Fowler
Martin Fowler
L
LINUX DO - 热门话题
NISL@THU
NISL@THU
阮一峰的网络日志
阮一峰的网络日志
C
Cybersecurity and Infrastructure Security Agency CISA
博客园_首页
Google DeepMind News
Google DeepMind News

博客园 - Liu Jian

C#的栈(Stack)和堆(Heap) A low-level Look at the ASP.NET Architecture(引自:http://www.west-wind.com/presentations/howaspnetworks/howaspnetworks.asp 从底层了解ASP.NET架构(引自:http://tech.it168.com/msoft/2007-12-24/200712241034626.shtml) [Joe 原创]Web Control 开发系列(四) Validation机制 [转贴]使用ADO.NET2.0提升数据交互性能(http://dotnet.chinaitlab.com/ADONET/739268.html) - Liu Jian - 博客园 Define a Custom Control Builder for a Custom Server Control(http://www.aspnetpro.com/newsletterarticle/2006/05/asp200605de_l/asp200605de_l.asp) [Joe 原创]Web Control 开发系列(三) 解析IPostBackEventHandler和WebForm的事件机制 [Joe 原创] Web Control 开发系列(二) 深入解析Page的PostBack过程和IPostBackDataHandler [Joe 原创]Web Control 开发系列(一) 页面的生命周期 Web Control 开发系列 之 前言 ASP.NET MVC 学习: 视图(http://whx.tzgt.gov.cn/newOperate/html/1/12/123/12058.html) ASP.NET MVC框架(第一部分)(http://blog.joycode.com/scottgu/archive/2007/11/14/111385.aspx) (转贴的)如何开发Firefox插件 Cross Domain XmlHttpRequests (http://benreichelt.net/blog/2005/4/11/Cross-Domain-XmlHttpRequests-Ajax/) Cross Domain XmlHttpRequests (http://benreichelt.net/blog/2005/4/11/Cross-Domain-XmlHttpRequests-Ajax/) 跨域(cross-domain)访问 cookie (读取和设置)(http://www.dup2.org/node/384) ajax跨域和js跨域解决方案(http://hi.baidu.com/longniao/blog/item/ce5e9cca3e2a4782c817684d.html) Javascript 内存泄漏问题(http://hi.baidu.com/webworker/blog/item/25f9f0dcf14d51a2cc116671.html) JavaScript内存泄漏(http://www.blogjava.net/tim-wu/archive/2006/05/29/48729.html)
关于ResolveClientUrl和ResolveUrl的使用 问题 (http://www.cnblogs.com/borllor/archive/2008/02/25/1081037.html)
Liu Jian · 2008-06-24 · via 博客园 - Liu Jian

两个方法都是传递一个相对的 URL,然后返回一个相对于当前客户端浏览器的相对URL地址
但是两者的返回值,却截然不同
ResolveClientUrl返回相对于当前页面下文件的地址
ResolveUrl则返回页面所在应用程序下的相对地址
例如:
页面:~/Student/main.aspx
图像:~/Images/copy.gif
(这里~表示应用程序根目录)
使用一:
resolveClientUrl=Page.ResolveClientUrl("Images/copy.gif")
resolveUrl=Page.ResolveUrl("Images/copy.gif")
在页面main.aspx里使用copy.gif图像,则使用标题上的两种方法返回的结果如下
ResolveClientUrl:Images/copy.gif
ResolveUrl:/Student/Images/copy.gif


使用二:
resolveClientUrl=Page.ResolveClientUrl("~/Images/copy.gif")
resolveUrl=Page.ResolveUrl("~/Images/copy.gif")
在页面main.aspx里使用copy.gif图像,则使用标题上的两种方法返回的结果如下
ResolveClientUrl:../Images/copy.gif
ResolveUrl:/Images/copy.gif


结论
所以在使用ResolveClientUrl和ResolveUrl的时候一定要注意两者的区别
在使用相对URL地址时一定要在前面加上(~)或(~/),这样就万无一失了
不过使用这两种方法返回的物理路径(Server.MapPath),都是一样的