I've looked everywhere but not found an answer to what should be a simple question. How can I set up Images and ImageButtons to be dealt with as arrays? Most "answers" to this that I've seen link to this page:
Which is a much more complicated solution than I need or can handle.
Here's an example. I want to build a page that has 64 ImageButtons. The ImageURLs for these should be set in some sort of for-loop in the code-behind, and there should be one single OnClick event that can tell which button triggered it.
Psuedo-code of what I would like to see happen:
<asp:Button ID="Button1" runat="server" OnClick="Button_Click" />
<asp:Button ID="Button2" runat="server" OnClick="Button_Click" />
<asp:Button ID="Button3" runat="server" OnClick="Button_Click" />...
protected void Page_Load(object sender, EventArgs e)
for (i=0; i<64; i++)
protected void Button_Click(object sender, EventArgs e)
// somehow tell which button triggered the event, and switch based on that value