<asp:Repeater ID="repeator1" runat="server"> <HeaderTemplate> </HeaderTemplate> <ItemTemplate> <table> <tr> <td> <asp:Label ID="name" runat="server" Text='<%#Eval("Name")%>'></asp:Label> </td> <tr> <td> <asp:Image Width="100" ID="Image1" ImageUrl='<%# Bind("Logo", "~/Images/{0}") %>' runat="server" /> </td> </tr> </tr> </table> </ItemTemplate> </asp:Repeater>
protected void Page_Load(object sender, EventArgs e) { SqlConnection con = new SqlConnection(@"data source=#######;Integrated Security=true;initial catalog=#####"); con.Open(); SqlCommand cmd = new SqlCommand("select * from Allapps", con); DataSet ds = new DataSet(); SqlDataAdapter da = new SqlDataAdapter(cmd); da.Fill(ds); repeator1.DataSource = ds; repeator1.DataBind(); }
RepDetails_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType.ToString().ToLower() == "item") { LinkButton l = (LinkButton)e.Item.FindControl("LinkButton1"); l.PostBackUrl = "yourpage.aspx?title='" + l.Text + "'"; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)