开发者

asp.net page's preinit event

开发者 https://www.devze.com 2023-03-07 03:52 出处:网络
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.

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.


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.


You need to do some reading:

http://msdn.microsoft.com/en-us/library/ms178472.aspx#lifecycle_events

0

精彩评论

暂无评论...
验证码 换一张
取 消