Click here to Skip to main content
14,735,910 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
how to display image and data in Repeater Control in & c sharp.
Please Send me a application urgent
Updated 2-Oct-17 22:17pm

Check this link it will help you:[^]

Application you have to do your self.It will help you to create that application.
Try this for displaying image using repeater control, guess it helps you..

Display Image
Here u have to maintain the image Folder which contains all the images and the Filename only taken from database
<asp:Repeater ID="repeatimages" runat="server" >
<table border="1" width="100%">
<td><asp:Label ID="lbl" runat="server" Text='<%#Eval("uname") %>'></asp:Label> </td>
<td><%#Eval("upass")%> </td>
<img  src="../image/<%# Eval("photo") %>" alt="" />

In Code behind

string query = "select * from Profiledetails";
SqlConnection con = new SqlConnection(conn);
SqlDataAdapter da = new SqlDataAdapter(query, con);
DataSet ds = new DataSet();
repeatimages.DataSource = ds;
for dispalying image in repeater control try:
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString2 %>"

            SelectCommand="SELECT * FROM [country]"></asp:SqlDataSource>
        <asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource1" OnItemDataBound="Repeater1_ItemDataBound">
             <asp:HiddenField Value='<%# Eval("id") %>' ID="HiddenField1" runat="server" />
             <asp:Image ID="Image1" runat="server" />

and in aspx.cs

protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e)
       HiddenField hf =  e.Item.FindControl("HiddenField1") as HiddenField;
       if (hf != null)
           string val = hf.Value;
           Image img = e.Item.FindControl("Image1") as Image;
           img.ImageUrl = "~/image" + val + ".jpg";


for more refer :[^][^]
Member 11202135 24-Nov-14 23:35pm
second image overwrites the first image

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