G
Guest
I am assigning a dynamic imagebutton on a page and then assiging it a Click
event with the following code, to pass the string "test" to the DeleteDetail
method
testImgBtn.ID = "imgBtn" + loopnumber;
testImgBtn.ImageUrl = "imgs/delete_16.gif";
testImgBtn.AlternateText = "Delete this detail";
testImgBtn.Style["background-color"] = "#B4B4B4";
testImgBtn.Click += new ImageClickEventHandler(DeleteDetail("test"));
The method very simply is
protected void DeleteDetail(string id)
{
Response.Write(id);
}
However when i try to compile this, i get "Method name expected" error on
the Click line in the original code
Can anyone help with this one?
event with the following code, to pass the string "test" to the DeleteDetail
method
testImgBtn.ID = "imgBtn" + loopnumber;
testImgBtn.ImageUrl = "imgs/delete_16.gif";
testImgBtn.AlternateText = "Delete this detail";
testImgBtn.Style["background-color"] = "#B4B4B4";
testImgBtn.Click += new ImageClickEventHandler(DeleteDetail("test"));
The method very simply is
protected void DeleteDetail(string id)
{
Response.Write(id);
}
However when i try to compile this, i get "Method name expected" error on
the Click line in the original code
Can anyone help with this one?