在Web应用程序中快速绑定图像的最佳方法是什么? [英] What is best way to bind images fastly in web appication?

查看:125
本文介绍了在Web应用程序中快速绑定图像的最佳方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Web应用程序中快速绑定图像的最佳方法是什么?
还告诉我如何?

What is best way to bind images fastly in web application?
also tell me how to ?

推荐答案

您要在哪里绑定图像?


您好...
已用于从db.like
显示图像的数据列表 .aspx:
Hi...
Am used datalist for display images from db.like
.aspx:
<asp:DataList ID="DataList1" runat="server" Height="82px"

        ItemStyle-HorizontalAlign="Center" RepeatColumns="3" Width="180px" EnableViewState="true">
<ItemStyle HorizontalAlign="Center"></ItemStyle>
        <ItemTemplate>
        <asp:Image ID="img1" ImageUrl='<%# Bind("Name", "~/Images/{0}") %>' Width="250" Height="180" runat="server" />
        <asp:HyperLink ID="HyperLink1" Text='<%# Bind("Name") %>' NavigateUrl='<%# Bind("Name", "~/Images/{0}") %>' runat="server"/>
            </ItemTemplate>
    </asp:DataList

<asp:Button ID="btnpv" Text="previous" runat="server" style="font-weight: 700" Visible="true" Width="66px" onclick="btnpv_Click" />
            

    <asp:Button ID="btnx" Text="Next" runat="server" style="font-weight: 700" Visible="true" Width="52px" onclick="btnx_Click" />


aspx.cs:

DirectoryInfo dir = new DirectoryInfo(MapPath("Images"));
            FileInfo[] files = dir.GetFiles();
            ArrayList listitems = new ArrayList();
foreach (FileInfo info in files)
            {
                    listitems.Add(info);
            }
// bind images on conditional
            adsource = new PagedDataSource();
            adsource.DataSource = listitems;
            adsource.PageSize = 3;
            adsource.AllowPaging = true;
            adsource.CurrentPageIndex = pos;
            btnx.Visible = true;
            //btnx.Enabled = !adsource.IsFirstPage;
            btnpv.Visible = true;
            btnpv.Enabled = !adsource.IsFirstPage;
            DataList1.DataSource = adsource;
            DataList1.DataBind();


谢谢你.


Thank u.



您没有提及要在何处和何处显示图像,以及如何列出这样做的可能性.

1.显示图像基于使用HANDLER的用户选择 [ 2.存储在数据库中并在网格视图中检索. [ 3.CP文章,用于在ASP.NET中显示二进制图像 [ ^ ]

希望您找到出路,
问候
Hi,
You have not mentiones from where and to where you want to display the images, and how am listing the near possibilities of doing the same.

1.Displaying Image based on the User selection using HANDLER [^]

2.Storing in Database and retrieving in the Grid view.[^]

3.CP Article to Display Binary Images in ASP.NET[^]

Hope you find your way out,
Regards,


这篇关于在Web应用程序中快速绑定图像的最佳方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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