图像下方的列表视图...图像下方的文本 [英] List view with Images....text below image

查看:75
本文介绍了图像下方的列表视图...图像下方的文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含图像的列表视图...我需要显示图像的名称...在图像下方应显示的图像...使用C#.net Windows应用程序

I have a List View With Images...I need to display the name of the image...below the image the should be display...using C# .net windows application

推荐答案


我不知道您是将图像URL保存在数据库中还是二进制数据中.如果将图像的地址保存在数据库中,则可以使用这段代码在ListView中显示图像.您可以在图像之后或之前显示每个数据:
Hi,
I don''t know whether you save image URLs in your database or a binary data. If you save image''s addresses in your db, then, you can you this piece of code to show images in the ListView. You can show every data after or before images:
<asp:DataList ID="DataList1" runat="server" DataSourceID="SqlDataSource1" 

            RepeatColumns="5">
            <ItemTemplate>
                <asp:Image runat="server" ID="img1" ImageUrl='<%# Eval("Text") %>' />
                <br />
                <asp:Label Text='<%# Eval("StartYear") %>' runat="server" ID="txt"></asp:Label>
            </ItemTemplate>
        </asp:DataList>


<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%


ConnectionStrings:YourConnectionName %> " span> SelectCommand SELECT前10个[文字],[开始年份]来自[tbl_FishMessage]" < /asp:SqlDataSource >
ConnectionStrings:YourConnectionName %>" SelectCommand="SELECT top 10 [Text], [StartYear] FROM [tbl_FishMessage]"> </asp:SqlDataSource>



希望对您有帮助,
干杯.



I hope it helps,
Cheers.


这篇关于图像下方的列表视图...图像下方的文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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