当我尝试从子文件夹文件访问 CSS 或 JS 文件时,我无法获得正确的路径en/Default.aspx
。
我有以下文件夹结构
Default.aspx
en/Default.aspx
en/MasterPage.master
ar/Default.aspx
ar/MasterPage.master
scripts/slider/script.js
styles/slider-en.css
scripts/slider/jquery.easing.js
en/Default.aspx
文件中的代码
<%@ Page Title="" Language="C#" MasterPageFile="~/en/MasterPage.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Default" %>
<%@ Register Src="~/en/UserControls/ucSliderHP.ascx" TagName="ucSlider" TagPrefix="uc"%>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server"></asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
<script src="../scripts/slider/jquery.easing.js" type="text/javascript"></script>
<script src="../scripts/slider/script.js" type="text/javascript"></script>
<link href="<%= Page.ResolveUrl("./styles/slider-en.css") %>" rel="stylesheet" type="text/css" />
<div id="content-container-750">
<!-- Slider -->
<!-- Sidebar -->
<div id="sidebar-container-240"></div>
<!-- Sidebar -->
<div id="Slider-Wrapper-750x300">
<uc:ucSlider ID="NewsSlider" runat="server" />
</div>
<!-- Slider -->
<!-- Banner -->
<div id="content-Banner-750x100HP">
</div>
<!-- Banner -->
<!-- Article -->
<div id="article-wrapperHP">
</div>
<!-- Article -->
</div>
</asp:Content>
当我使用../
路径时,它总是返回路径为
http://localhost:49831/en/scripts/slider/script.js
当我使用 `Page.ResolveURL 或 ResolveURL 它返回我的路径为
http://localhost:49831/website/en/Default.aspx?language=en-us&issue=5
我不知道我应该怎么做我尝试过../../
它也不起作用