..SingLu" <su@yahoo.com> wrote in message
news:OE**************@TK2MSFTNGP02.phx.gbl...
I'm going nuts here. I'm using VS2005 and C# and would like to create a
simple page and use the page_init-event. I add a new page but can't find a
way to make VS add a eventhandler. If I dbl.click the page I get a
page_load method - but I want to see a list of possible events (including
page_init). If a select the document and look in the property-window
theres no "flash" to show me a list of events (like there is where using a
control). Its so easy in VB - how is it done in c#?
It appears that all you have to do is add an appropriately-named method
(e.g. Page_Init, Page_PreRender, etc.) with the correct signature to the
code-behind file and it will be automatically invoked. In my case I wanted
to handle PreRender and I added the method:
protected void Page_PreRender(object sender, EventArgs e)
{
...
}
and it just worked! However, it seems EXTREMELY bizarre to me that there is
no nice way to get a list of the possible events and to name the handler
whatever you like.
Chris Jobson