.ascx page_load event

M

MeDhanush

Hi,

I'm curious about the way user control .ascx gets access to the
Page_Load event.
As custom user control's inheritance is,
Object
^
|
|
Control
^
|
|
TemplateControl
^
|
|
UserControl
^
|
|
CustomUserControl
In this inheritance tree, there is no page object.
So, does user control gets access to Page_Load event just by declaring
in the web form Page ? Can sb pl clarify this for me ?

TIA
Kishore
 
P

PJ

I'm not sure what you mean by getting access to the page load event. When a
page parses the text in the aspx page, it creates an appropriate object for
that control and gives a reference to that control w/ any variable that is
declared in the page class that has the same name as the id
attribute/property of the control. This happens in the AddParsedSubObject
event before the Page_Load is run. Also, controls have a .Page property
that is a reference to the page that they belong to.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top