Brock Allen wrote:
Every contol has access to the page via Control.Page. You can then use
FindControl or just iterate over the Control.Page.Controls collection.
Ok, I'm showing my newbie side here, but I can't seem to get this to
work. For sake of argument I've got an ID="testBody" and a RUNAT on the
BODY element.
In my control:
public HtmlGenericControl myBody;
public void Page_Load()
{
myBody = Control.Page.FindControl("testBody");
}
I also tried
public Control myBody;
I'm getting an error:
An object reference is required for the nonstatic field, method, or
property 'System.Web.UI.Control.Page'
I know I'm just not declaring something right (still getting my head
around the object model), do I have to set something to be inheriting
the page or something?
Joe