Why don't the images don't show up on my ASP.Net core website?

J.Tian

I have an asp.net core web application and I want to add photos to it but when i try to debug it on IIS express, only the image icon shows up and I'm not quite sure what to do. All of my images are jpg's and are in a folder inside of the wwwroot folder. This is how I reference the photos:

<img src="~/Images/picture.JPG" />

I am not sure what to do to make the photos show up.

Ateik

Make sure you allowing static files to be served:

public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
{
    app.UseStaticFiles();
}

You can read more about it from here: https://docs.asp.net/en/latest/fundamentals/static-files.html

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Why don't my rectangles show up?

Fonts from my website don't show up on iOS

Why is my first activity don't show up?

Why don't Font Awesome icons show up in my anchor?

Why don't my unauthorized controllers return 401 ASP.Net Core?

Images don't show in drupal

Images in CSV file don't show up in Anki

images don't show up using <img> HTML tag

Django images don't show up on the web-site

Why don't my vtt subtittles show up on my html5 video?

At Github Pages my website don't show photos

Why don't I get a error logs for 500 Interal Errors in my logs directory in ASP.NET Core

Why don't my views show up in Storyboards and are greyed out in the left pane?

How to return a format string and why my button don't show up?

Why don't some of my applications show up in the launcher when opened?

Why do projects that I add to my 'workspace' folder don't show up? [ECLIPSE]

Why my image don't show up on the device where i tested it?

Functions in my powershell profile don't show up?

my codes in react don't show up in browser

In a SVG file my CSS hidden text don't show up

Why don't bootstrap codes run on my django website?

The JFrame "Window" and its contents don't show up, why?

Why don't locale variables show up in the output of env or printenv?

Why don't AngularJS errors in the html show up in the console?

Why don't components show up in the Design Mode in Android Studio?

Why don't my images load in Vue.js 2?

My images overlap each other and I don't know why

Why won't images show up in copyright section of WordPress website?

Why don't my column headings line up?