Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>It's nasty, but here goes...</p> <pre><code> Dim skusTable As New HtmlTable Dim i As Integer Do While reader.HasRows Do While reader.Read i = i + 1 Dim tNewRow As New HtmlTableRow tNewRow.ID = "MyRow" &amp; i Dim cellSKU, cellDESCR, cellDept1, cellDeptGrp1, cellDeptRng1, cellStand, cellBoard, cellSelect As New HtmlTableCell cellSKU.InnerHtml = "&lt;a href='edit.aspx?edit=" &amp; reader("SKUN") &amp; "'&gt;" &amp; reader("SKUN") &amp; "&lt;/a&gt;" cellDESCR.InnerText = reader("DESCR") cellDept1.InnerText = reader("DPT1") cellDeptGrp1.InnerText = reader("GRP1") cellDeptRng1.InnerText = reader("RNG1") cellBoard.InnerText = reader("BOARD") cellStand.InnerText = reader("STAND") 'Create the checkbox as a webcontrol and add it to the table cell Dim checkBox As New HtmlControls.HtmlInputCheckBox checkBox.Value = reader("SKUN") checkBox.ID = "selectedSKU" cellSelect.ID = "SelectedCell" cellSelect.Controls.Add(New WebControls.CheckBox) tNewRow.Cells.Add(cellSKU) tNewRow.Cells.Add(cellDESCR) tNewRow.Cells.Add(cellDept1) tNewRow.Cells.Add(cellDeptGrp1) tNewRow.Cells.Add(cellDeptRng1) tNewRow.Cells.Add(cellStand) tNewRow.Cells.Add(cellBoard) tNewRow.Cells.Add(cellSelect) tNewRow.Style.Add("border", "solid 1px #cccccc") skusTable.Rows.Add(tNewRow) Loop reader.NextResult() Loop </code></pre> <p>Now all you need do is use FindControls to get to the element...</p> <pre><code> Dim myRow As HtmlControls.HtmlTableRow = skusTable.FindControl("MyRow" &amp; i) 'Probably be good to check the object exists first.... If Not myRow Is Nothing Then Dim myCell As HtmlControls.HtmlTableCell = myRow.FindControl("SelectedCell") If Not myCell Is Nothing Then Dim myCheckbox As HtmlControls.HtmlInputCheckBox = myCell.FindControl("selectedSKU") If Not myCheckbox Is Nothing Then 'Got it! now is it selected? Return myCheckbox.Checked End If End If End If </code></pre>
 

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