all groups > asp.net > may 2004 >
You're in the

asp.net

group:

Access to parent objects


Re: Access to parent objects Teemu Keiski
5/2/2004 8:24:28 PM
asp.net:
Hi,

via Page property of your control (which it has by default) you can access
the top-level Page object from which you can search child controls with
FindControl method.

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist
http://blogs.aspadvice.com/joteke


[quoted text, click to view]
Hi guys ,
i create a custom control and place it on a web form,
how can i access to this web form from my custom control ?

for example i want to add a button to this webform by writing code in my
custom control.

Thanx :)


Access to parent objects SOS
5/2/2004 9:08:22 PM
Hi guys ,
i create a custom control and place it on a web form,
how can i access to this web form from my custom control ?

for example i want to add a button to this webform by writing code in my
custom control.

Thanx :)

Re: Access to parent objects Rick Spiewak
5/2/2004 9:42:31 PM
All web controls inherit a .Parent property.

[quoted text, click to view]

Re: Access to parent objects SOS
5/3/2004 5:35:20 PM
Thanks
but when i use of this property in my class constructer
i get this error : Object reference not set to ...


[quoted text, click to view]

Re: Access to parent objects Rick Spiewak
5/3/2004 11:08:49 PM
The parent won't exist until you add your control to the page's or form's
controls collection.

[quoted text, click to view]

AddThis Social Bookmark Button