I have looked at other post but nothing explained what I want to do very well.
At runtime I have x amount of LinkButtons added to the form by a repeater dependant on the data it retrieves from the database:
<asp:Repeater ID="variantRepeat" runat="server"
onitemcommand="variantRepeat_ItemCommand">
<HeaderTemplate><ul></HeaderTemplate>
<ItemTemplate><li><asp:LinkButton ID="varLink" runat="server" CommandName="Click" CommandArgument='<%# Eval("variantID") %>'><%# Eval ("variant_name") %></asp:LinkButton></li></ItemTemplate>
<FooterTemplate></ul></FooterTemplate>
</asp:Repeater>
It is supposed to, when clicked Fire of an event backstage
protected void varLink_Click(object sender, EventArgs e)
{
ViewCollection views = prodView.Views;
}
Then set up some views. However I need the CommandArgument to go through as that holds the key to look up inside the prodView.Views .
It doesn't have to be variantID that is passed but could be and Int depending on which one, just need some indication as to what view to display!
I have all the views created at page init and added to the page dynamically at init.
I use the entity framework to query the database through a few views! (found that to be easier to get complex data from relational databases!)
I don't know how to link up all those LinkButtons so that I can programmatically switch views?