Reputation: 241
I am new to asp.net. I have an aspx page and i have to write some code in its PreInit event. From where i find PreInit event on the page. As we double click on button to get button click event(or selecting button and select event from property pane) Plz reply me ASAP.
Upvotes: 3
Views: 10894
Reputation: 405
Man, why do you need the mouse?
If you need to write some code into PreInit just write the code:
protected virtual void OnPreInit(EventArgs e)
{
base.OnPreInit(e);
//your code
}
or in class constructor add a event handler for it:
...
PreInit += new EventHandler(SomeMethodName)
...
and define the event handler method
private void SomeMethodName(object sender, EventArgs e)
{
//your code
}
And by the way, check a .Net Framework book and a Visual Studio manual.
Upvotes: 3
Reputation: 9954
You need to do some reading:
http://msdn.microsoft.com/en-us/library/ms178472.aspx#lifecycle_events
Upvotes: 0