简体   繁体   English

如何在脚本标签中找到定义根目录

[英]How to find define root directory in script tag

When publishing my web application for the first time. 首次发布我的Web应用程序时。 I've noticed that all source paths defined in the aspx pages ,that are not located in the root, have lost their link for example this one: In debug mode it worked fine. 我注意到,在aspx页面中定义的所有源路径(不在根目录中)都失去了链接,例如以下链接:在调试模式下,它工作正常。 Just when published it doesn't work anymore. 只是在发布时它不再起作用。 Even though the directory structure remains. 即使目录结构保持不变。

Any idea what the cause might be and how to solve it? 知道原因可能是什么以及如何解决? I know I can use '..' if I want to go one directory up. 我知道如果要向上一个目录,可以使用“ ..”。 But isn't there a way that I can say that it should look directly from the home directory down to the right file. 但是没有一种方法可以说,它应该直接从主目录查找到正确的文件。

尝试

<script type="text/javascript" src="<%= Page.ResolveClientUrl("~/jquery.js") %>"></script>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM