Asp.net Javascript运行服务器错误:不是有效的虚拟路径

Asp.net Javascript运行服务器错误:不是有效的虚拟路径,javascript,asp.net,runatserver,Javascript,Asp.net,Runatserver,您好,我想在我的页面中包含一个javascript,如下所示: <script runat="server" id="js_common_FluidInput" type="text/javascript" src="https://file.domain.com/Script/Common/FluidInput.js"></script> 但我得到了这个错误: https:/file.domain.com/Script/Common/FluidInput.j

您好,我想在我的页面中包含一个javascript,如下所示:

   <script runat="server" id="js_common_FluidInput" type="text/javascript" src="https://file.domain.com/Script/Common/FluidInput.js"></script>

但我得到了这个错误:

https:/file.domain.com/Script/Common/FluidInput.js'不是有效的虚拟路径

我已经找到了这个解决方案,但我真的希望会有更好的解决方案:

       <% #if DEBUG %>
<script type="text/javascript src="https://file.domain.com/Script/Common/FluidInput.js"></script><% #else %><asp:literal runat="server" id="jsAncor" ></literal><% #endif %> 


ayilmaz是对的,由于某些原因,当您使用用户runat=“server”时,您不能使用完整路径,只能使用相对路径


在我的其他带有相对路径的标签上,可以使用runat=“server”

您不需要runat=“server”id=“js\u common\u FluidInput”。请删除这些并构建…你能在
JavaScript
标记中使用
runat
吗?我需要在服务器上运行这个,因为我需要在服务器端进行一些url转换