Summary:
I want to to create a templateField
resulting from a database after calling gridview.databind
to have it function as a linkbutton doing something when pressing it.
In other words, I want to bind a templateField
with data at runtime.
<asp:GridView ID="GridView1" runat="server">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton ID="LinkButton1" runat="server" OnClick="lclick">Buy</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
protected void lclick(object sender, EventArgs e)
{
// your function
}