如何在MVC VB应用程序中使用图像 [英] How to use an image in MVC VB application

查看:73
本文介绍了如何在MVC VB应用程序中使用图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好。我正在研究mvc vb应用程序,在我的一个视图中,我想要显示如下图像:



Hi, everyone. I am working on mvc vb application and in one of my views I want to show an image like this:

@<img src="Content/Images/Tick-512.png" />





但输出图像已损坏。任何人都可以帮助我以正确的方式使用这个图标吗?



我尝试过:



我尝试了几个其他的陈述,但我没有成功显示我想要的图像。



but the output is broken image. Can anyone help me how to use this icon in the proper way?

What I have tried:

I tried a couple of other statements but I didnot succeed to show the image that I want.

推荐答案

<img src="@Url.Content("~/Content/Images/Tick-512.png")" />



或者,如果您使用的是MVC4或更高版本:


Or, if you're using MVC4 or later:

<img src="~/Content/Images/Tick-512.png" />



MVC中的图像链接很神奇(大部分) [ ^ ]


这篇关于如何在MVC VB应用程序中使用图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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