Posted on: 6/10/2013 7:49:08 PM | Views : 386

Hello,
I have several dynaimically created buttons. An error was thrown when a duplicate button ID was contained on the same page.  I resolved that but caused another issue. By using a Guid to generate the ID, took care of duplicate ID issue; However, the assigned click (or command) event doesn't want to fire.  Why would changing to a Guid cause the event not to fire?
for (int i = 0; i < ButtonCollection.Length; i++) { XElement xParent = xml.XPathSelectElement("Parent/xmlElement[@ID='" + ButtonCollection[i] + "']"); Button b = new Button(); b.ID = Guid.NewGuid().ToString(); b.BackColor = ColorTranslator.FromHtml(xParent.Attribute("Color").Value.ToString()); b.Click += History_Click; b.Command += History_Click; b.ToolTip = xParent.Attribute(&q ...

Go to the complete details ...