Click to See Complete Forum and Search --> : Findcontrol textbox within html table


bhargav
01-13-2009, 02:23 AM
Hi,
I created a custom control in ascx page(Ctrl.ascx). The control is a html table(tblCustom) with single column with textbox(ctl21_TextBox1), text area and a dropdown in 3 rows.

i am adding the control to a panel in my aspx.vb page.

d = LoadControl("~\Controls\Ctrl.ascx")
Panel.Controls.Add(d)

I need to set the values to the textbox(along with the controls within the table)

when im doing a find control on the textbox, it is returning nothing.

txt = CType(d.FindControl("tblCustom").FindControl("ctl21_TextBox1"), TextBox)

How can i assign a value to the textbox.

chazzy
01-13-2009, 07:02 PM
unless i'm misunderstanding what you're trying to do, you just want the Text attribute.

bb.geetha@gmail
11-05-2009, 04:50 AM
TextBox txt = new TextBox();
txt = (TextBox)(this.FindControl("TextBox1"));
txt.Text = "abc";