Hi,
You can write "override" and when you press space, intellisence will start
working. Then you can write which event you want to override. For example:
protected override void OnLoadComplete(EventArgs e)
{
base.OnLoadComplete(e);
}
And depending on your choice, you can write your code before, after or
before and after executing the "base.OnLoadComplete" method. Also, you can
completely remove it if you don't want it to execute anything in the base
class.
Other than that, you may want to add a IsPostBack control before hooking the
event in Page Load:
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
Page.LoadComplete += new EventHandler(Page_LoadComplete);
}
}

Signature
All the best,
Coskun SUNALI
MVP ASP/ASP.NET
http://sunali.com
http://www.propeople.dk
> So by default the editor only throws in "protected void Page_Load"
> event.
[quoted text clipped - 29 lines]
> kellygreer1@nospam.com
> change nospam to yahoo
Scott Roberts - 06 Feb 2008 17:42 GMT
> Other than that, you may want to add a IsPostBack control before hooking
> the event in Page Load:
[quoted text clipped - 6 lines]
> }
> }
It seems like the "Page_LoadComplete executing twice" problem would stem
from having AutoEventWireup set to true and then wiring up the event in page
load too, not from IsPostBack.
kellygreer1 - 06 Feb 2008 17:50 GMT
> Hi,
>
[quoted text clipped - 60 lines]
> > kellygre...@nospam.com
> > change nospam to yahoo
Sorry two follow up questions:
Why does "Page_Load" or "Page_LoadComplete" even work without the
wiring (explicitly setting the EventHandler)?
How many of these things are "AutoMagically" triggered by the ASP.NET
engine?
This is the only way I can figure that one method was fired twice.
Kelly
Scott Roberts - 06 Feb 2008 18:46 GMT
> Sorry two follow up questions:
> Why does "Page_Load" or "Page_LoadComplete" even work without the
> wiring (explicitly setting the EventHandler)?
Search help for AutoEventWireup. You will probably find
"AutoEventWireup=true" in your @Page declaration in the .aspx page. You can
set it to "false" to disable the behavior.
> How many of these things are "AutoMagically" triggered by the ASP.NET
> engine?
I believe that it is only Page events.
> So by default the editor only throws in "protected void Page_Load"
> event.
[quoted text clipped - 29 lines]
> kellygre...@nospam.com
> change nospam to yahoo
For C# the easiest way to create event handlers other than the most
common ones (e.g. click event for say a LinkButton where all you have
to do is double-click the object in Design view) is to open up the
Properties window and select the control. At the top of the properties
window there is a control button with a sort of yellow jagged shape
icon. Click that and you will see a list of events rather than the
usual properties. Double-click the event that you wish to code and the
code page will be opened with the outline for the event already
created, (just like in VB when you use the drop-down lists at the top
of the code page).