Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

C# ASP.NET MVC Basics Modeling and Presenting Data Improving Our View Layout

Stephen Stewart
Stephen Stewart
5,727 Points

Image not Displaying

Hiya,

Everything is working well and smoothly, however, I noticed that when you downloaded the bootstrap with all the content etc.. Mine was already pre-installed. As was thinking that when you downloaded that it already had the image within that folder. Is there a way to get the image that you used and put them into the Content?

3 Answers

Simon Sporrong
Simon Sporrong
35,097 Points

Hi! I had the same issue and after some digging i found that the CoverImageFileName-string returns "the-amazing-spiderman-700" and the actual filename was "the-amazing-spider-man-700". So all I did was to change the filename in the Images folder. Hope that helps!

Randy Layne
seal-mask
MOD
.a{fill-rule:evenodd;}techdegree seal-36
Randy Layne
Treehouse Moderator

Hi Stephen,

are you referring to the Spiderman Comic image? When you download the project files it will contain several more zip files corresponding to the each video in the course. The simplest way I found to get the image was to unzip the "aspnet-comic-book-gallery-5.6.zip" file and navigate to src>ComicBookGallery>Images>the-amazing-spider-man-700.jpg

Hope this helps! Randy

I am also having an issue with the image. This is how it looks in the model class:

public string CoverImageFileName { get { return "the-amazing-spider-man-700.jpg"; //literal copy-paste of the name //SeriesTitle.Replace(" ", "-").ToLower() + "-" + IssueNumber + ".jpg"; } }

and in the view:

<div class="col-md-6"> <img src="/Images/@Model.CoverImageFileName" alt="@Model.DisplayText" class="img-responsive" /> </div>