Dynamically create an ImageButton
<p>I’m trying to dynamically declare an ImageButton.</p>

<p>I declare it and assign an ID and Image to it as follows:</p>

<pre><code>ImageButton btn = new ImageButton();
btn.ImageUrl = "img/Delete.png";
btn.ID = oa1[i] + "_" + i;
btn.OnClick = "someMethod";
</code></pre>

<p>But when I try to assign an OnClick handler for the button it throws the following exception:</p>

<pre><code>System.Web.UI.WebControls.ImageButton.OnClick is inaccessible due to protection level
</code></pre>
