如何从MVC中的资源文件加载图像? [英] How to load image from resource file in MVC?
本文介绍了如何从MVC中的资源文件加载图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在多语言网站中更改资源文件中的图像任何人都可以帮助我在mvc 5中实现这一目标。
我尝试了什么:
我无法分享我的代码bcz我无法在办公室以外共享我的代码。请为此
I want to change image from resource file in multilingual website can anyone help me to achieve this in mvc 5.
What I have tried:
I am not able to share my code bcz i can't share my code outside office.Sorry for this
推荐答案
您好,
我使用以下方法从资源文件加载图像文件,
方法1:
[ ^ ] < br $>
或
方法2:使用ASP.Net MVC Razor组件
@if(imagePath!=){
< img src =@ imagePathalt =示例图片width =300px/> < br $>
}
如果你已经尝试过这种方法,请ase让我知道你是否有任何问题
Hello ,
I have used the below approach to load image file from resource file,
Approach 1 :
[^]
Or
Approach 2: using ASP.Net MVC Razor component
@if(imagePath != ""){
<img src="@imagePath" alt="Sample Image" width="300px" />
}
if you already tried this approach, please let me know if you have any issues in that
这篇关于如何从MVC中的资源文件加载图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文