Try a relative path.
<img src="/images/MyLogo2.png" alt="My Logo" />
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
hi all,
I have a sample project (NET 8, ASP.NET Core MVC) and I added a few Controllers and Views.
Controllers: Home Controller, Group1Controller, Group2Controller
Views: Home folder: Index.cshtml, Privacy.cshtml
Group1 folder: Index.cshtml
Group2 folder: Index.cshtml
Models folder:
BaseViewModel.cs
ErrorViewModel.cs
and Program.cs directly under the project folder
Without entering any other details is it possible to know what I am missing knowing that I can
navigate to https://localhost:7114 and https://localhost:7114/Group2 and https://localhost:7114/Group2/Index and
https://localhost:7114/Group2/Index/2 or https://localhost:7114/Group2/Index/3 or any other id just by typing these paths, however I can see a logo only when I go to https://localhost:7114/Group2
The Index.cshtml in the Group2 folder does have the line:
<td style="width: 200px; height: 100px" rowspan="4"><img src="images/MyLogo2.png" alt="My Logo" /></td>
I believe https://localhost:7114/Group2 and https://localhost:7114/Group2/Index and https://localhost:7114/Group2/Index/2 they all display the Index.cshtml in the Group2 folder. Yet only https://localhost:7114/Group2 will display the logo, all other urls are missing the logo (and only the logo).
Can you please let me know what am I missing?
thanks,
elsvieta
Try a relative path.
<img src="/images/MyLogo2.png" alt="My Logo" />
If you used the browsers debug tools, you would have seen the found error, and the bad path.