在视图中显示图像(剃刀视图) [英] displaying images in a view (razor view)

查看:122
本文介绍了在视图中显示图像(剃刀视图)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个有书籍属性的书籍模型。还具有具有书籍图像的图像文件夹。我希望在一个视图中显示它们,就像每行有3到4本书的图像,下面有文字。(基本上发送带有图像的书籍列表)经过多次尝试,我真的很难受。我的图像和东西太弱了。



请给我一个非常简单的guidline来跟随。



我必须使用CSS,然后我在那里做什么?



我必须在书模型中有一个url属性吗?怎么样? >


我必须获取图像文件夹的URL吗?那我该怎么做?



请举一个很好的例子给我一个好方向。



我今天需要完成它。我已经尝试了一个星期。

I have a book model having book properties. Also having an image folder having book images. I want to display them in a view like each row having 3 to 4 book images with text underneath.(basically sending a list of books with the image) I''m having real dificulties after tried so many times. I''m so weak in images and stuff.

please give me very simple guidline to follow.

do i have to use css, then what do i do in there?

do i have to have a url property in the book model?how

do i have to get the url to the image folder? then how do i do that?

please give me a good direction by a good example.

I need to finish it today.as I hvae been trying this for a week.

推荐答案

此链接将帮助您显示您期望的图像。在这个例子中,他们使用viewengine作为.aspx。所以请把它转换成Razor

http://www.c-sharpcorner.com/uploadfile/dhananjaycoder/working-with-images-in-Asp-Net-mvc-framework/ [ ^ ]



希望这有助于
This link will help you to display images what you have expect. In this example they are using viewengine as .aspx. So Please convert this in to Razor
http://www.c-sharpcorner.com/uploadfile/dhananjaycoder/working-with-images-in-Asp-Net-mvc-framework/[^]

Hope this helps


这篇关于在视图中显示图像(剃刀视图)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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