Javascript Function dont works on dynamically created ImageButton (ASP.NET)
<p>Got something like this:</p>

<pre><code>    protected void Page_Init(object sender, EventArgs e)
    {
        LoadImageButtons();
    }

    private void LoadImageButtons()
    {
        for (int i = 1; i &lt; 10; i++)
        {
            ImageButton myImageButton = new ImageButton();

            myImageButton .ID = i.ToString();
            myImageButton .CssClass = "buttonFieldClass";
            myImageButton .Click += new ImageClickEventHandler(einButton_Click);
            myImageButton .OnClientClick = "toRight(this.id);return false";

            div.Controls.Add(myImageButton);
        }
    }
</code></pre>

<p>Javascript (Jquery):</p>

<pre><code>function toRight(id) {
$("#id").animate({ "left": "+=250px" }, "slow");};
</code></pre>

<p>and nothing happens (with static controls it works).. So I think something with the ID goes wrong.. Hope u guys can help me ..</p>
