您在哪里存储asp.net mvc项目的图像,以及如何从site.master引用它们 [英] Where do you store images for asp.net mvc projects and how do you reference them from site.master

查看:62
本文介绍了您在哪里存储asp.net mvc项目的图像,以及如何从site.master引用它们的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个新的asp.net mvc项目,我试图找出存储图像的最佳位置,以及如何从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).

建议或最佳做法?

推荐答案

我通常要做的是在Content文件夹中创建一个"Images"文件夹.只要您保持一致,放置图像的位置实际上取决于您.

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.

从Site.Master中引用这些图像与从任何视图中引用它们相同:

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

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

这篇关于您在哪里存储asp.net mvc项目的图像,以及如何从site.master引用它们的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆