asp.net页面的preINIT事件 [英] asp.net page's preinit event

查看:310
本文介绍了asp.net页面的preINIT事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新来asp.net。我有一个aspx页面,我必须写在preINIT事件的一些code。
从我在网页上找到preINIT事件。
当我们双击按钮获得按钮单击事件(或选择按钮,并从物业窗格中选择的事件)
PLZ尽快回复我。

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?

如果你需要写一些code到preINIT只写code:

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)
...

和定义事件处理方法

private void SomeMethodName(object sender, EventArgs e)
{
   //your code
}

和的方式,检查.Net框架的书和一个Visual Studio手册。

And by the way, check a .Net Framework book and a Visual Studio manual.

这篇关于asp.net页面的preINIT事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆