I'm looking for assistance with overcoming an issue I have been having with an asp.net web application for the past 6 weeks. Any assistance would be tremendously beneficial.
The web application I’m working on will ultimately reset Sybase accounts across 30+ database instances. The current layout of the application is as follows:
Up to this point I have working. Below is what I need help on.
Below is the code I’m working with that does not work:
foreach (object o in envPnl2.Controls)
{
CheckBox chk = o as CheckBox;
if (chk == null)
continue;
if (chk.Checked)
resetPassword(chk.Text);
}
Below is the code I’m using to create the checkbox and add them to a table (for alignment):
void createDynChks(int c, string db)
TableRow tr = new TableRow();
// Create column 1
TableCell td1 = new TableCell();
// Create a checkbox control dynamically
CheckBox _checkbox = new CheckBox();
_checkbox.ID = db;
_checkbox.Text = db;
if ((c == 2) || (c == 4))
_checkbox.Enabled = false;
// Add control to the table cell
td1.Controls.Add(_checkbox);
// Add cell to the row
tr.Cells.Add(td1);
tr.HorizontalAlign = HorizontalAlign.Left;
// Add row to the table.
if (cntclmn == 1)
tblDyn1.Rows.Add(tr);
if (cntclmn == 2)
tblDyn2.Rows.Add(tr);
if (cntclmn == 3)
tblDyn3.Rows.Add(tr);
if (cntclmn == 4)
tblDyn4.Rows.Add(tr);
if (cntclmn == 5)
tblDyn5.Rows.Add(tr);
Please help if anyone can offer a direction.-Dan