<asp:Repeater ID="Repeater1" runat="server" OnItemCommand="Repeater1_ItemCommand"> <HeaderTemplate> <table> <td> Name </td> </HeaderTemplate> <ItemTemplate> <tr> <td> <asp:LinkButton ID="LinkButton1" OnClick="Amitesh_Click" runat="server" Text='<%#Eval("Name") %>' CommandArgument='<%#Eval("ID") %>' CommandName="bind" PostBackUrl="~/home/Amitesh"></asp:LinkButton> </td> </tr> </ItemTemplate> <FooterTemplate> </table> </FooterTemplate>
protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e) { if (e.CommandName == "bind") { string ID = e.CommandArgument.ToString(); cmd = new SqlCommand("select * from UserDetails where ID='" + ID + "'", con); con.Open(); da = new SqlDataAdapter(cmd); da.Fill(dt); GridView1.DataSource = dt; GridView1.DataBind(); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)