When working on my project, I encountered an issue with calling external scripts
, img links
, and related resources in the HomeMaster page
. My project structure includes a Home.aspx
page within the homepage
folder of an asp.net empty web site
created using VS2019. However, when running the Home.aspx
page, the css
, js
, and img
links are not loading properly.
This is the structure of my project:
https://i.sstatic.net/xizuA.png
In the HomeMaster page, I call the scripts
and img
links as follows:
In the header
<head runat="server">
<meta charset="utf-8">
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<title>Path</title>
<meta content="" name="description">
<meta content="" name="keywords">
<!-- Favicons -->
<link href="../assets/img/favicon.png" rel="icon">
<link href="../assets/img/apple-touch-icon.png" rel="apple-touch-icon">
<!-- Google Fonts -->
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i|Raleway:300,300i,400,400i,500,500i,600,600i,700,700i|Poppins:300,300i,400,400i,500,500i,600,600i,700,700i" rel="stylesheet">
<!-- Vendor CSS Files -->
<link href="../assets/vendor/aos/aos.css" rel="stylesheet">
... (Other link imports)
<!-- Main CSS File -->
<link href="../assets/css/style.css" rel="stylesheet">
<asp:ContentPlaceHolder id="head" runat="server">
</asp:ContentPlaceHolder>
</head>
After the footer content in the body, I call the related js files:
<body>
<form id="form1" runat="server">
<div>
<asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
<!-- Vendor JS Files -->
<script src="../assets/vendor/purecounter/purecounter_vanilla.js"></script>
... (Other script imports)
<!-- Main JS File -->
<script src="../assets/js/main.js"></script>
</div>
</form>
</body>
Additionally, in the Home.aspx
page, I call the img
links as shown below:
<%@ Page Title="" Language="C#" MasterPageFile="~/HomeMaster.master" AutoEventWireup="true" CodeFile="Home.aspx.cs" Inherits="homepage_Home" %>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
... (Image links including client-1.png to client-6.png)
</asp:Content>
Despite no errors occurring while running the Home.aspx
page, the images fail to display. This troubleshooting process is new to me, so any guidance on identifying mistakes and resolving them would be greatly appreciated.
Please lend a helping hand!