Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

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!

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>