Here is a quick code snippet, that doesn't seem to work at all for me. I'm reading from a file to create a list of radio buttons. The problem is that when one of the radio buttons is clicked the Event Handler I have set up in the code doesn't fire. I have tested it over and over in debug mode with line breaks... all with no luck. Am I missing something obvious here????
Thanks in Advanced!
strLine = strLine.Trim();
System.Diagnostics.Debug.WriteLine("[3-a] ship by date - date: " + strLine);
try{ shipByDate = (Convert.ToDateTime(strLine)); }
catch (Exception e) { shipByDate = new DateTime(); }
shipByDesc = sr.ReadLine().Trim();
System.Diagnostics.Debug.WriteLine("[3-b] ship by date - desc: " + shipByDesc);
RadioButton button = new RadioButton();
button.Text = shipByDesc + " - " + shipByDate.ToString("MM/dd/yyyy");
button.Checked = false;
button.GroupName = "shipByOptions";
button.ID = "shipByRadio" + count;
//button.EnableViewState = true;
button.AutoPostBack = true;
button.CheckedChanged += new EventHandler(shipBy_CheckedChanged); // <-- doesn't work!!!
//form1.Controls.Add(button);
shipByPlaceHolder.Controls.Add(button);