Note that there are some explanatory texts on larger screens.

plurals
  1. POAll of a sudden dynamic created imagebutton's click event wont fire.
    text
    copied!<p>I have a page that dynamic create a table of contacts, if the contact got an email I also create an image button with a click event.I have a similar function in the rest of the page that works perfectly. And I used this before without any problems:</p> <pre><code>protected void CreateContactsList(IQueryable&lt;AA_BranschFinder.Login.vyWebKontaktpersoner&gt; lContacts) // Creates a table in the aspx from an IQueryable List { if (1 == 1) { htmlTblContactsContent.Rows.Clear(); foreach (var p in lContacts) { HtmlTableRow tr = new HtmlTableRow(); HtmlTableCell tdName = new HtmlTableCell(); HtmlTableCell tdCompanyName = new HtmlTableCell(); HtmlTableCell tdEmailAdress = new HtmlTableCell(); tdName.InnerHtml = p.strFnamn + " " + p.strEnamn; tdCompanyName.InnerHtml = p.strNamn; //Displays an image if the contacts has an email if (p.strEpost != null) { ImageButton imgEmail = new ImageButton(); imgEmail.CommandArgument = p.intKundID.ToString(); imgEmail.ImageUrl = "images/symbol_letter.gif"; imgEmail.CssClass = "letter"; imgEmail.Click +=new ImageClickEventHandler(imgEmail_Click); tdEmailAdress.Controls.Add(imgEmail); } tr.Cells.Add(tdCompanyName); tr.Cells.Add(tdEmailAdress); tr.Cells.Add(tdName); htmlTblContactsContent.Rows.Add(tr); } } } void imgEmail_Click(object sender, ImageClickEventArgs e) { </code></pre> <p><em>Breakpoint here</em> throw new NotImplementedException(); }</p> <p>The page is living inside a java popup window. But I have paging numbers with similar event creation that works fine. But they are Linkbuttons. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload