Where can I find these events

  • Thread starter Thread starter Tony Johansson
  • Start date Start date
T

Tony Johansson

Hello!

Normally all events can be found in the lightning bold in the property page
but how can I find these.

protected void Page_Load(object sender, EventArgs e)
{
}

protected void Page_Init(object sender, EventArgs e)
{
}

protected void Page_PreRender(object sender, EventArgs e)
{

}

//Tony
 
Hello!

Normally all events can be found in the lightning bold in the property page
but how can I find these.

protected void Page_Load(object sender, EventArgs e)
{
}

protected void Page_Init(object sender, EventArgs e)
{
}

protected void Page_PreRender(object sender, EventArgs e)
{

}
ASP.NET webforms do not make use of property pages like ,NET winforms
do. The Page_Load method is automatically stubbed out when the page is
added to the project.

Page_Init and Page_PreRender are the names of specific events which
have pre-existing event handlers at lower levels. These event handlers
are prefixed with On and can be overridden. In the page's .cs files
type override as if you're adding a new method. Hitting the space bar
will bring up Intellisense. Select OnPage_Init and an overridden
handler will be stubbed out. Do the same thing and select
OnPage_PreRender and that overridden handler will be stubbed out as
well.

regards
A.G.
 
Registered User said:
ASP.NET webforms do not make use of property pages like ,NET winforms
do. The Page_Load method is automatically stubbed out when the page is
added to the project.

Page_Init and Page_PreRender are the names of specific events which
have pre-existing event handlers at lower levels. These event handlers
are prefixed with On and can be overridden. In the page's .cs files
type override as if you're adding a new method. Hitting the space bar
will bring up Intellisense. Select OnPage_Init and an overridden
handler will be stubbed out. Do the same thing and select
OnPage_PreRender and that overridden handler will be stubbed out as
well.

regards
A.G.

This was a good way but I noticed I can also do it in this way.

I can also use the page event but to be able to access the page event I
must view the Component designer for the page.
I get there by right clicking the given page and choose view Component
designer. Selecting this option open that page property window including the
events.

//Tony
 
Back
Top