Click here to Skip to main content
15,886,026 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
What is best way to bind images fastly in web application?
also tell me how to ?
Posted

Where are you going to bind the images?
 
Share this answer
 
Comments
Thanks7872 4-Jul-13 0:06am    
This is not an answer.Post it as comment.
Hi...
Am used datalist for display images from db.like
.aspx:
XML
<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:
C#
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.
 
Share this answer
 
v2
Comments
The Doer 11-Jul-13 5:48am    
what is adSource ,btnx and btnpv here?
[no name] 11-Jul-13 7:25am    
Here: PagedDataSource adsource=new PagedDataSource;
btnx means Next and btnpv Privious button for page goes next and privious page perpouse.
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,
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900