I do it when I dynanmically create the table control.
The table is placed on a panel control dynamically based on parameters to
the type of question template selected by the admin user. I'm trying t
create a "Range" type answer where there is an "Answer_1" and an "Answer_2"
box the end user fills in. The number of possible options are unknown at
design time, so it has to be done dynamically.
Txs,
--
Bill Jones
"vMike" wrote:
>
> "Bass Pro" <> wrote in message
> news:5B77B793-EAD4-4A80-8EEB-...
> > How do I access a textbox when it was added to a table cell?
> > I've tried using the findcontrol function with no result.
> >
> > I create it as such...
> > Dim myTable As Table = New Table
> > Dim Row as TableRow
> >
> > row = New TableRowI
> > Answer_1 = New TextBox
> > Answer_1.Width = New Unit("100px")
> > Answer_1.Text = " "
> > cell = New TableCell
> > cell.Controls.Add(Answer_1)
> > row.Cells.Add(cell)
> > myTable.Rows.Add(row)
> > myTable.ID = "myTable5"
> > I expected this to work:
> > tl = CType(pnlBoard.FindControl("myTable" &
> > CStr(QuestionTypeID)), Table)
> >
> > tb =
> CType(tl.Rows(0).Cells(0).FindControl("Answer_1"),
> > TextBox)
> > and it doesn't. tb is always "Nothing".
> >
> > Where am I wrong?
> > TIA.
> > --
> > Bill Jones
>
> I don't see were you are giving the textbox an id as in
> Answer_1.ID="Answer_1"
>
>
>
>
|