Re: how to retrieve control value from dynamically created controls



2 points:

1. You need to re-create dynamically created controls on every postback,
preferably in Page_Init event.

2. Controls property contains only immediate children. You need to drill
down row-cell-checkbox.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net


"Dica" <genpub5@xxxxxxxxxxx> wrote in message
news:qwwei.6056$xk5.1118@xxxxxxxxxxx
i've got a script that creates a new tablerow + tablecell and appends that
to a non dynamically created table control. a new row is added for each
recordset returned from my sql statement. within each tablecell, i place a
dynamically created checkbox control. i now need to fetch back the value
of the checkbox as follows:

foreach (Control c in tblServices.Controls) {
}

this doesn't work, however. if i step through with the debugger, the only
controls listed under tblServices are the tablerows, not the checkbox.

how do i navigate down to the checkbox control so i can fetch the value?

tks.






.



Relevant Pages

  • Re: check boxes, eye dots ...
    ... So what is the step/steps to get to checkbox control ... ... > TIA ... >> VBA code would read the controls' values and do something with them. ...
    (microsoft.public.access.modulesdaovba)
  • Re: ActiveControl in Form View
    ... >I have a form with a checkbox control and a text field. ... >My question is why does Access think the window is not active? ... Is ActiveControl not available in the ...
    (microsoft.public.access.formscoding)
  • Re: Using checkbox to place todaysa date
    ... I have tried your suggestion Vandals, but error messages says " Compiled ... Could you give me more explanation. ... In the checkbox control, use the OnClick event to populate the Textbox. ...
    (microsoft.public.access.forms)
  • Bound table updates in one field but not another. A97
    ... It is displayed in datasheet view in the subform control. ... checkbox control) and a numeric field. ... source query is comprised of several tables. ...
    (comp.databases.ms-access)
  • Re: Using checkbox to place todaysa date
    ... you need to include the new field/column in the Form’s Record Source ... In the checkbox control, use the OnClick event to populate the Textbox. ... And to idiot proof the checkbox. ...
    (microsoft.public.access.forms)