如何在参数值中仅使用相对路径?
<param name="source" value= "/ClientBin/Gantt_SL1.xap"/>
这涉及 HTML 标记和 Silverlight。基本上在标记中我有上面的行。我想做的是在整个标记中使用这个相对路径。我在其他子文件夹中有不同的网页,也引用了此 SL xap。然而,当我想使用它时,我必须做这样的事情:
<param name="source" value= "../ClientBin/Gantt_SL1.xap"/>
我不必担心必须在路径前面放置多少个“../”以确保它得到解决。是否有 .NET、Javascript 或 JQuery 方法允许我使用根目录、子文件夹、子文件夹的子文件夹中的相对路径,而无需执行整个“../”业务?像这样的东西:
//from some library
<param name="source" value= ResolveFullPath("/ClientBin/Gantt_SL1.xap")/>
<param name="source" value= "/ClientBin/Gantt_SL1.xap"/>
This involves HTML markup and Silverlight. Basically in the markup I have the line above. What I would like to do is use this relative path throughout my markup. I have different web pages in other sub folders that also reference this SL xap. When I want to use it however, I have to do something like this:
<param name="source" value= "../ClientBin/Gantt_SL1.xap"/>
I rather not have to be worrying about how many "../" I have to put in front of a path to make sure it gets resolved. Is there a .NET, Javascript, or JQuery method that allows me to use the relative path in the root, sub-folder, sub-folder of a sub-folder without doing the whole "../" business? Something like:
//from some library
<param name="source" value= ResolveFullPath("/ClientBin/Gantt_SL1.xap")/>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 ResolveUrl:
You can use ResolveUrl: