Got something like this:
protected void Page_Init(object sender, EventArgs e)
{
LoadImageButtons();
}
private void LoadImageButtons()
{
for (int i = 1; i < 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);
}
}
Javascript (Jquery):
function toRight(id) {
$("#id").animate({ "left": "+=250px" }, "slow");};
and nothing happens (with static controls it works).. So I think something with the ID goes wrong.. Hope u guys can help me ..