visual-studio Page.PreLoad 事件未出现在 Visual Studio 中

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/929449/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-22 10:34:32  来源:igfitidea点击:

Page.PreLoad Event not showing up in visual studio

asp.netvisual-studio

提问by JL.

I am wondering why I can't see all page events in visual studio 2008, when I click on the events combobox, only the page_load event is in there. What can I do to see all page life cycle events in the combo, so I can just click it to generate the event template?

我想知道为什么我在 Visual Studio 2008 中看不到所有页面事件,当我单击事件组合框时,只有 page_load 事件在那里。我该怎么做才能看到组合中的所有页面生命周期事件,以便我只需单击它即可生成事件模板?

回答by Andrija

here is page life cycle: http://msdn.microsoft.com/en-us/library/ms178472.aspx

这是页面生命周期:http: //msdn.microsoft.com/en-us/library/ms178472.aspx

you can't see events because they are not written in code page yet, you have to write them yourself (if you mean the combo box in code behind page on top)

你看不到事件,因为它们还没有写在代码页中,你必须自己编写它们(如果你指的是顶部代码后面的组合框)

if you already have AutoEventWireup="true" set, just write in code:

如果您已经设置了 AutoEventWireup="true",只需编写代码:

protected void Page_PreLoad(object sender, EventArgs e)
{
   // handle code
}