......
string wellId = row["WID"].ToString();
img =  new HtmlImage();
img.ID= wellId.Replace("-","").Replace(" ","");
img.Alt= wellId;
img.Attributes["onclick"] = "ChangeImg(" + img.ID + ")";
......