How to use .FindControl

  • Thread starter Thread starter Dave
  • Start date Start date
D

Dave

How can I use .FindControl to find an HTML <Table></Table> that's
nested in a FormView? I'm using the 3.5 Framework.

Thanks
 
Dave said:
How can I use .FindControl to find an HTML <Table></Table> that's
nested in a FormView? I'm using the 3.5 Framework.

FindControl will only find it if you marked it as "runat='server'" and
assigned an ID. You pass this ID to FindControl:

<table id="tbl" runat="server">...</table>

HtmlTable tbl = (HtmlTable)FormView1.FindControl("tbl");
 
Spoke too soon. I'm using the System.Web.UI.WebControls name space as
indicated in Books On Line, but I can't declare an HtmlTable
variable. It's not in the Intellisence list

Suggestions?
 
Found it!

System.Web.UI.HtmlControls;

duh



Spoke too soon.  I'm using the System.Web.UI.WebControls name space as
indicated in Books On Line, but I can't declare an HtmlTable
variable.  It's not in the Intellisence list

Suggestions?





- Show quoted text -
 
Back
Top