Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where do you store images for asp.net mvc projects and how do you reference them from site.master

I have a new asp.net mvc project and i am trying to figure out the best place to store images and also how i would reference them from site.master (in cases where i have a header images that i want to show up on all pages).

Suggestions or best practices?

like image 649
leora Avatar asked Jun 30 '09 16:06

leora


People also ask

How can save image in folder in ASP NET MVC?

string filePath = "~/Uploads/" + fileName; //Save the Image File in Folder. postedFile. SaveAs(Server.

Which MVC folder of ASP Net is used for storing application data?

The App_Data folder of MVC application is used to contain the application related data files like . mdf files, LocalDB, and XML files, etc.


1 Answers

What I generally do is create an "Images" folder inside my Content folder. Where you place your images is really up to you, as long as you are consistent.

Referencing these images from your Site.Master is the same as if you referenced it from any view:

<img src="/Content/Images/mylogo.png" /> 

alt text

like image 157
A Salcedo Avatar answered Oct 22 '22 07:10

A Salcedo