How to Subscribe to Pages in the Visual Studio 2008 IDE

IMPORTANT
Can any body solve this problem?
How to create pages for event handlers Init, Load, PreRender, etc. in VS 2008? When we double-click on the page, it will raise the Page_Load event. How to create othere page events? I am using C # in an ASP.NET application.
enter image description here
There is no image on the Event tab.

+3
source share
5 answers

Here is your answer
In the solution explorer, right-click on the page and select "View Component Designer" from the context menu, now in the properties window you will see the events tab.

+3
source

:

  • on_xxx Web.UI.Page. private override, , Intellisense , , ( ).

  • AutoEventWireup, true, Page_[your event] Page_Init . .

    ASP.NET , AutoEventWireup Web Forms . AutoEventWireup @page TRUE ( , TRUE), ASP.NET .

    , - Page_Init Page_Load ASP.NET .

    AutoEventWireup , . .

</" > :

  • PreInit
  • Init
  • Initcomplete
  • PreLoad
  • Load
  • LoadComplete
  • PreRender
  • SaveStateComplete
  • Render

</" > cheetsheet MSDN, , :

enter image description here

+3

. msdn " ", , .

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

(, , datacontrols) #, , , .

enter image description here

+1

On , override OnLoad , OnPreRender .. , :

protected override void OnInit(EventArgs e)
{
   base.OnInit(e); //don't remove
}

, :

protected void Page_Init(object sender, EventArgs e)
{

}

- ( ), 100%.

.

+1

: http://msdn.microsoft.com/en-us/library/6w2tb12s%28v=VS.90%29.aspx ( VS 2008)

, Page_event.

, , Page_Load.

ASP.NET pages automatically associate page events with methods that are named Page_event. This auto-binding is set by the AutoEventWireup attribute in the @Page directive, which is set to true by default. If AutoEventWireup is set to false, the page will not automatically search for methods that use the Page_event naming convention.

Worked for me!

0
source

Source: https://habr.com/ru/post/1791695/


All Articles