img.Attributes.Add("onclick", "javascript:form1.elements[\"TextBox1\"].value=\"" + img.ImageUrl + "\"");