mercredi 5 août 2020

Binding image from sql server to repeater in asp not loading?

I want to bind image from SQL server to repeater in asp, the image is not loading here is my codes when binding the image in not loading can you help please?enter image description here

    <asp:Repeater ID="RepterDetails" runat="server"  >  

<HeaderTemplate>Products View</HeaderTemplate>  
    <ItemTemplate>
    <asp:Label ID="lblSubject" runat="server" Text='<%#Eval("Title") %>' Font-Bold="true"/>



      <hr />  <asp:Image ID="Image1" runat="server" ImageUrl='<%#Eval("img1") %>' Width="100" Height="100" AlternateText="No picture found"  Visible="true"/>
        
        <hr />
   
         Post By: <asp:Label ID="lblUser" runat="server" Font-Bold="true" Text='<%#Eval("Name") %>'/> 
         Created Date:<asp:Label ID="lblDate" runat="server" Font-Bold="true" Text='<%#Eval("Date") %>'/>
        <asp:Button ID="Button1" runat="server" Text="Order Now" />
  <hr />
    </ItemTemplate>  
    <FooterTemplate>  
    </FooterTemplate>  
    </asp:Repeater>  

        public void RepeterData()
        {
            con.Open();
            cmd = new SqlCommand("Select * from [Products T]", con);
            DataSet ds = new DataSet();
            da = new SqlDataAdapter(cmd);
            da.Fill(ds);
            RepterDetails.DataSource = ds;
            RepterDetails.DataBind();
            con.Close();
        }



Aucun commentaire:

Enregistrer un commentaire