如何在gridview中连续显示图像 [英] how to display images in gridview in a row

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

问题描述

我已将图像保存在数据库中。有些客户会有30个,另外有50个......等等。

我想检索并在前端显示图像。 gridview中有一个图像按钮。

在一行中我必须显示8个图像。一旦显示8个图像,自动第9-16个图像应该在新行中。如何编码...我可以使用gridview吗?或者我需要动态创建表...建议我.........

i have saved images in database. Some customers will have 30, another 50... and so on.
I want to retrieve and display the images at front-end. There is one image button inside gridview.
In one row i have to display 8 images. once 8 images are displayed, automatically the 9-16th image should be in new row.how to code for that... can i use gridview? or i need to create table dynamically... suggest me.........

推荐答案

如果你只想显示图像,那就去吧 HTML 表格。



但是, GridView 也是在浏览器端呈现为 HTML 表。但 GridView 还有许多其他功能,您可能不会使用它们。那么,为什么让页面变重呢?



只需去 HTML 表并申请 CSS 用于格式化行和单元格的样式。



祝你好运,继续编码。 :)
If you only want to display the images, then go for HTML table.

However, GridView is also rendered as HTML table at the browser end. But GridView has many other functionality, which you may not use. So, why to make the page heavy?

Just go for HTML table and apply CSS styles to format the rows and cells.

Good luck, keep coding. :)


请参阅下面的参考资料



http://msdn.microsoft.com/en-us/library/aa479350.aspx [ ^ ]



http://highoncoding.com/Articles/166_Displaying_Images_in_a_GridView.aspx [ ^ ]
Please see below references

http://msdn.microsoft.com/en-us/library/aa479350.aspx[^]

http://highoncoding.com/Articles/166_Displaying_Images_in_a_GridView.aspx[^]


更好的方法是使用数据列表。此外,您还可以对每行的图像进行自定义。

请参阅此链接
In better way you can use data list.In this also you can do customization for images per rows.
Refer this link


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

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