I have a method that add's an onclick event too an imagebutton.But sometimes you have to press the button multiple times before the "pop-up" window opens.Any idea why this happens?this is my code were I add the event to my imagebutton:\[code\]private void AddProjectDetails() { ImageButton imgBtn; HiddenField hfld; String ProjectNumber; for (int i = 0; i < GridViewProperties.Rows.Count; i++) { hfld = GridViewProperties.Rows.FindControl("HiddenProjId") as HiddenField; imgBtn = GridViewProperties.Rows.FindControl("ibtnShowExtra") as ImageButton; ProjectNumber = hfld.Value; imgBtn.Attributes.Add("onclick", "window.open('ProjectDetails.aspx?ProjectNumber=" + Server.UrlEncode(ProjectNumber) + "','Graph','height=590,width=600,left=50,top=50,scrollbars=yes'); return true;"); } }\[/code\]