K
kellygreer1
So by default the editor only throws in "protected void Page_Load"
event.
What is the correct way to add in other events.
I had in the past copied the events from other pages where I had
manually typed them in such as:
protected void Page_LoadComplete(object sender, EventArgs e)
{
}
So recently I started to skip this ... thinking there was an easier
way... and I started wiring these up in the Page_Load event. Example:
protected void Page_Load(object sender, EventArgs e)
{
this.Page.LoadComplete += new EventHandler(Page_LoadComplete);
}
This is great because it throws in all the scaffold-like code that I
need.
But I just noticed today that this causes my Page.LoadComplete method
to be run twice!
What is the proper way to do this stuff in C# ASP.NET 2.0? I know
VB.NET has the nice dropdown at the top that helps you declare the
Page events. What is the right way to do this in C#?
Thanks,
Kelly Greer
(e-mail address removed)
change nospam to yahoo
event.
What is the correct way to add in other events.
I had in the past copied the events from other pages where I had
manually typed them in such as:
protected void Page_LoadComplete(object sender, EventArgs e)
{
}
So recently I started to skip this ... thinking there was an easier
way... and I started wiring these up in the Page_Load event. Example:
protected void Page_Load(object sender, EventArgs e)
{
this.Page.LoadComplete += new EventHandler(Page_LoadComplete);
}
This is great because it throws in all the scaffold-like code that I
need.
But I just noticed today that this causes my Page.LoadComplete method
to be run twice!
What is the proper way to do this stuff in C# ASP.NET 2.0? I know
VB.NET has the nice dropdown at the top that helps you declare the
Page events. What is the right way to do this in C#?
Thanks,
Kelly Greer
(e-mail address removed)
change nospam to yahoo